test case 3
Test the block-func being used in callee
Demo
source
Main task yaml file
tasks:
- name: task
task:
- func: cmd
desc: |
test var overriding in sub_task
dvars:
- name: aaa
value: var_a_from_task
flags:
- taskScope
- func: call
do:
- sub_task
- name: sub_task
task:
- func: block
vars:
aaa: var_a_from_sub_task
do:
- func: cmd
desc: |
inspect if the correct parameter has been passed in correctly
with default value
in block func
do:
- name: assert
cmd:
- '{{eq .aaa "var_a_from_task"}}'
- func: shell
do:
- echo "{{.aaa}}"
Main log file
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0161
Verbose -> vvv
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/c0161
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: ]
-Step1: [
test var overriding in sub_task
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"aaa": "var_a_from_task"
})
WARN: [cmd] - [Not implemented or void for no action!]
-Step2:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"aaa": "var_a_from_task"
})
=Task2: [task ==> sub_task: ]
--Step1:
self: final context exec vars:
(*core.Cache)({
"aaa": "var_a_from_task",
"up_runtime_task_layer_number": 1
})
--Step1: [
inspect if the correct parameter has been passed in correctly
with default value
in block func
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"aaa": "var_a_from_task"
})
~~SubStep1: [assert: ]
1 ASSERT OK: [{{eq .aaa "var_a_from_task"}}]
--Step2:
self: final context exec vars:
(*core.Cache)({
"aaa": "var_a_from_task",
"up_runtime_task_layer_number": 1
})
cmd( 1):
echo "{{.aaa}}"
-
var_a_from_task
-
.. ok
. ok
Logs with different verbose level
Raw logs with different verbose level