c0054_vvv
Log reference:
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0054
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/c0054
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: ]
-Step1:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0
})
cmd( 1):
echo "hello, world"
-
hello, world
-
.. ok
. ok
-Step2:
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "echo \"hello, world\"",
Code: 0,
Output: "hello, world",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0
})
condition failed, skip executing step
-Step3:
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)(<nil>),
"up_runtime_task_layer_number": 0
})
condition failed, skip executing step
-Step4: [
note that for one step, there will be only one
return, which will be the last do cmd
in this case, since the step3 exit code is 0
the whole step will have the return code of 0
if you need to use the exit code of the step
you need to consider to reduce the number of do cmds
or put it to last step, this is not a bug
this is a feature
]
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)(<nil>),
"up_runtime_task_layer_number": 0
})
cmd( 1):
echo "step1"
-
step1
-
.. ok
cmd( 2):
echo "step2" |grep notexist
-
-
.. failed(suppressed if it is not the last step)
cmd( 3):
echo "step3"
-
step3
-
.. ok
. ok
-Step5:
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "echo \"step3\"",
Code: 0,
Output: "step3",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0
})
cmd( 1):
echo "hello, world"
-
hello, world
-
.. ok
. ok
-Step6:
dvar> last_task_succeeded:
"true"
-
true
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "echo \"hello, world\"",
Code: 0,
Output: "hello, world",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0,
"last_task_succeeded": "true"
})
cmd( 1):
echo "check last step"
-
check last step
-
.. ok
cmd( 2):
echo "{{.last_result|toJson}}"
-
{Cmd:echo "hello, world",Code:0,Output:hello, world,ErrMsg:}
-
.. ok
cmd( 3):
echo "{{.last_result|toPrettyJson}}"
-
{
Cmd: echo "hello, world",
Code: 0,
Output: hello, world,
ErrMsg:
}
-
.. ok
cmd( 4):
echo "{{eq .last_result.Code 0}}"
-
true
-
.. ok
. ok
-Step7:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"last_result": (*utils.ExecResult)({
Cmd: "echo \"true\"",
Code: 0,
Output: "true",
ErrMsg: ""
})
})
cmd( 1):
echo "step1"
-
step1
-
.. ok
cmd( 2):
echo "step2" |grep notexist
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
-Step8:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"last_result": (*utils.ExecResult)({
Cmd: "echo \"step2\" |grep notexist",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
condition failed, skip executing step
-Step9:
dvar> condition:
"true"
-
true
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)(<nil>),
"up_runtime_task_layer_number": 0,
"student": {
"sex": "male",
"age": 23,
"name": "peter"
},
"condition": "true"
})
cmd( 1):
echo "simple dvar as condition"
-
simple dvar as condition
-
.. ok
. ok
-Step10:
dvar> condition:
"true"
-
true
self: final context exec vars:
(*core.Cache)({
"condition": "true",
"last_result": (*utils.ExecResult)({
Cmd: "echo \"simple dvar as condition\"",
Code: 0,
Output: "simple dvar as condition",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0,
"student": {
"sex": "male",
"age": 23,
"name": "peter"
}
})
cmd( 1):
echo "complicated dvar evaluation as condition"
-
complicated dvar evaluation as condition
-
.. ok
. ok
-Step11:
dvar> condition:
"true"
-
true
self: final context exec vars:
(*core.Cache)({
"student": {
"name": "peter",
"sex": "male",
"age": 23
},
"condition": "true",
"last_result": (*utils.ExecResult)({
Cmd: "echo \"complicated dvar evaluation as condition\"",
Code: 0,
Output: "complicated dvar evaluation as condition",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0
})
cmd( 1):
echo "a even more complicated condition but more readable"
-
a even more complicated condition but more readable
-
.. ok
. ok
-Step12:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"student": {
"name": "peter",
"sex": "male",
"age": 23
},
"last_result": (*utils.ExecResult)({
Cmd: "echo \"a even more complicated condition but more readable\"",
Code: 0,
Output: "a even more complicated condition but more readable",
ErrMsg: ""
})
})
cmd( 1):
echo "a complicated condition without dvar"
-
a complicated condition without dvar
-
.. ok
. ok
-Step13: [
show that complicated arg needs to be quoted using ()
otherwise it will cause gt to be confused
]
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "echo \"a complicated condition without dvar\"",
Code: 0,
Output: "a complicated condition without dvar",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0,
"doc": "hello"
})
~SubStep1: [print: ]
true
-Step14:
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "echo \"a complicated condition without dvar\"",
Code: 0,
Output: "a complicated condition without dvar",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0,
"doc": "hello"
})
~SubStep1: [print: ]
true
Logs with different verbose level
References