github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0011.yml (about) 1 doc_meta: | 2 folder: scope 3 title: runtime merge 4 head: | 5 Demo the runtime global vars and local vars in func can be merged too 6 7 sections: 8 - title: Demo 9 log: yes 10 11 notes: 12 goal: 13 - test runtime vars could be merged properly 14 - test local vars could be merged properly 15 16 testresult: | 17 18 current exec runtime vars: 19 20 { 21 "a": "runtime-a", 22 "b": "non-prod-b", 23 "c": "dev-c", 24 "e": "local-e", 25 "k": "runtime-k", 26 "m": "local-m", 27 "d": "global-d" 28 } 29 30 executing shell commands 31 cmd( 1): 32 echo "test out the var scopes only" 33 test out the var scopes only 34 35 exec result: 36 code:0 37 error: 38 1001 39 (*cache.Cache)(0xc0000101f8)({ 40 "a": "runtime-a", 41 "b": "non-prod-b", 42 "c": "dev-c", 43 "e": "local-e", 44 "k": "runtime-k", 45 "m": "local-m", 46 "d": "global-d" 47 }) 48 49 scopes: 50 - 51 name: global 52 vars: 53 a: global-a 54 b: global-b 55 c: global-c 56 d: global-d 57 - 58 name: prod 59 members: [dr,prod] 60 vars: 61 a: prod-a 62 c: prod-c 63 64 - 65 name: nonprod 66 members: 67 - dev 68 - st 69 - staging 70 vars: 71 a: non-prod-a 72 b: non-prod-b 73 c: non-prod-c 74 75 - 76 name: staging 77 vars: 78 a: staging-a 79 b: staging-b 80 81 - name: dev 82 vars: 83 a: dev-a 84 c: dev-c 85 86 vars: 87 a: runtime-a 88 e: runtime-e 89 k: runtime-k 90 91 tasks: 92 93 - 94 name: task 95 task: 96 - 97 func: shell 98 vars: 99 e: local-e 100 m: local-m 101 do: 102 - echo "test out the var scopes only"