github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0133.yml (about) 1 doc_meta: | 2 folder: test-debug 3 title: failFast 4 head: | 5 Showcase to use failFast flag when use assert cmd 6 7 It will report all assert results but stop there 8 9 sections: 10 - title: Demo 11 log: yes 12 13 vars: 14 a: global_aaa 15 b: global_bbb 16 c: global_ccc 17 goahead: False 18 # goahead: True 19 20 tasks: 21 - name: task 22 task: 23 24 - func: block 25 desc: show example the route goes to call goelse for the condition of not if condition succeeds 26 vars: 27 a: local_aaa 28 b: local_bbb 29 dvars: 30 - name: da 31 value: local_da 32 - name: db 33 value: local_db 34 do: 35 - func: shell 36 do: 37 - echo "shell step1" 38 - echo "shell step2" 39 40 - func: cmd 41 vars: 42 a: block_layer1_aaa 43 dvars: 44 - name: db 45 value: local_db_layer1 46 47 do: 48 - 49 name: print 50 cmd: | 51 layer 1 52 up_runtime_task_layer_number: {{.up_runtime_task_layer_number}} 53 a: {{.a}} 54 b: {{.b}} 55 c: {{.c}} 56 da: {{.da}} 57 db: {{.db}} 58 59 - 60 name: assert 61 cmd: 62 - '{{eq .a "block_layer1_aaa" }}' 63 - '{{eq .b "local_bbb" }}' 64 - '{{eq .c "global_ccc" }}' 65 - '{{eq .da "local_da" }}' 66 - '{{eq .db "local_db_layer1" }}' 67 flags: [failFast,] 68 69 - func: shell 70 do: 71 - echo "shell step3" 72 - echo "shell step4" 73 74 - func: block 75 desc: test embeded 2nd layer of block 76 vars: 77 a: local_block_layer2_aaa 78 b: local_block_layer2_bbb 79 dvars: 80 - name: da 81 value: local_da_layer2 82 - name: db 83 value: local_db_layer2 84 do: 85 - func: cmd 86 vars: 87 a: block_layer2_aaa 88 do: 89 - 90 name: print 91 cmd: | 92 layer 2 93 up_runtime_task_layer_number: {{.up_runtime_task_layer_number}} 94 a: {{.a}} 95 b: {{.b}} 96 c: {{.c}} 97 da: {{.da}} 98 db: {{.db}} 99 100 - 101 name: assert 102 cmd: 103 - '{{eq .a "block_layer2_aaa" }}' 104 - '{{eq .b "local_block_layer2_bbb" }}' 105 - '{{eq .c "global_ccc" }}' 106 - '{{eq .da "local_da_layer2" }}' 107 - '{{eq .db "local_db_layer2" }}' 108 flags: [failFast,] 109 110 - func: shell 111 do: 112 - echo "shell step5" 113 - echo "shell step6"