c0154_v
Log reference:
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0154
Verbose -> v
ModuleName -> self
ShellType -> /bin/sh
MaxCallLayers -> 8
Timeout -> 3600000
MaxModuelCallLayers -> 256
EntryTask -> task
ModRepoUsernameRef ->
ModRepoPasswordRef ->
work dir: /up_project/up
-exec task: task
loading [Task]: ./tests/functests/c0154
module: [self], instance id: [dev], exec profile: []
Task1: [task ==> task: ]
-Step1: [
access a non-exist var will not cause error or panic while you render it
]
~SubStep1: [print: ]
None
-Step2: [
however if you access a non exist child element, then it will result in a warning error
]
~SubStep1: [print: ]
template rendering -> template: .:1:4: executing "." at <.b.not_exist>: can't evaluate field not_exist in type interface {}
WARN:
1:{{.b.not_exist}}
trouble shooting tips:
<incompatible types for comparison>: the variable might not be registered, use -v vvv to see the cache, or use inspect cmd to debug
-Step3:
~SubStep1: [query: if the sub element does not exist, eg school_name does not exit, then the query result will give the result of the closest element result, in this caes the parent value "aaa" will be return
]
~SubStep2: [query: ]
~SubStep3: [pathExisted: ]
~SubStep4: [pathExisted: the state will be rendered as <no value>, this will be treated as not exist
]
~SubStep5: [pathExisted: ]
element validating problem -> template: validator:1:4: executing "validator" at <.b.not_exist>: can't evaluate field not_exist in type interface {}
WARN:
1:{{.b.not_exist}}
~SubStep6: [print: ]
sydney_grammar.address exist: true
sydney_grammar.state exist: false
varb_sub_element_existed exist: false
-Step4: [: test pathExisted in templating ]
~SubStep1: [print: ]
element validating problem -> template: validator:1:4: executing "validator" at <.b.not_exist>: can't evaluate field not_exist in type interface {}
WARN:
1:{{.b.not_exist}}
element validating problem -> template: validator:1:4: executing "validator" at <.b.not_exist>: can't evaluate field not_exist in type interface {}
WARN:
1:{{.b.not_exist}}
sydney_grammar.address exist: true
sydney_grammar.state exist: false
varb_sub_element_existed exist: false
I am sad
-Step5:
~SubStep1: [inspect: ]
1: inspect[exec_vars]
(*core.Cache)({
"sydney_grammar": {
"address": "sydney"
},
"a": "aaa",
"myschool": (*string)("aaa"),
"up_runtime_task_layer_number": 0,
"state_existed": false,
"varb_sub_element_existed": false,
"b": "bbb",
"school_address": (*string)("sydney"),
"address_existed": true
})
~SubStep2: [assert: ]
1 ASSERT OK: [{{pathExisted "sydney_grammar.address" }}]
Logs with different verbose level
References