tasks:
- name: task
desc: |
please switch to use case1|case2 ...
the reason we do not chain all cases together is because
the venv will pollute the entire running session unless you mananage to restore it
task:
- func: call
do: case3
- name: case1
desc: ""
task:
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
case1: only source
source via the source content
do:
- name: virtualEnv
cmd:
source: |
echo "start of source"
export AAA=sourced_aaa
echo "end of source"
- func: shell
desc: |
after sourcing, the env var: AAA exist
do:
- env |grep AAA
- name: case2
desc: ""
task:
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
case2: only source
source via srcfile
do:
- name: virtualEnv
cmd:
srcfile: ./tests/functests/test_env.rc
- func: shell
desc: |
after sourcing, the env var: AAA exist
do:
- env |grep AAA
- name: case3
desc: ""
task:
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
no source/srcfile input
with name and action
now it will save current shell env
which has got no AAA in it
do:
- name: virtualEnv
cmd:
name: venv0
action: snapshot
- func: shell
desc: |
since there is no source, this will still cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
now source and save current shell environment variables
do:
- name: virtualEnv
cmd:
name: venv1
action: snapshot
srcfile: ./tests/functests/test_env.rc
- func: shell
desc: |
after sourcing, the env var: AAA exist
the error should be cleared
do:
- env |grep AAA
- func: cmd
desc: |
now let's restore to the point of venv0
which has got no AAA in it
do:
- name: virtualEnv
cmd:
name: venv0
action: restore
- func: shell
desc: |
this will still cause an error
as now the shell env is restored to venv0
which has got no AAA in it
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
now let's restore to the point of venv1
which has got AAA in it
we expect the error is clear
do:
- name: virtualEnv
cmd:
name: venv1
action: restore
- func: shell
desc: |
after sourcing, the env var: AAA exist
the error should be cleared
do:
- env |grep AAA
- name: case4
desc: ""
task:
- func: cmd
desc: |
source via the source content
do:
- name: virtualEnv
cmd:
source: |
echo "start of source"
export AAA=sourced_aaa
echo "end of source"
- func: shell
desc: |
after sourcing, the env var: AAA exist
do:
- env |grep AAA
- func: cmd
desc: |
if you use clean param
it will unset all env vars from the current execution context
do:
- name: virtualEnv
cmd:
action: pure
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0193
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/c0193
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: please switch to use case1|case2 ...
the reason we do not chain all cases together is because
the venv will pollute the entire running session unless you mananage to restore it
]
-Step1:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0
})
=Task4: [task ==> case3: ]
--Step1: [
before sourcing, the env var: AAA does not exist
this will cause an error
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1
})
cmd( 1):
env |grep AAA
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
--Step2: [
no source/srcfile input
with name and action
now it will save current shell env
which has got no AAA in it
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
--Step3: [
since there is no source, this will still cause an error
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
cmd( 1):
env |grep AAA
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
--Step4: [
now source and save current shell environment variables
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
start of source
end of source
--Step5: [
after sourcing, the env var: AAA exist
the error should be cleared
]
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
}),
"up_runtime_task_layer_number": 1
})
cmd( 1):
env |grep AAA
-
AAA=sourced_aaa
-
.. ok
. ok
--Step6: [
now let's restore to the point of venv0
which has got no AAA in it
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 0,
Output: "AAA=sourced_aaa",
ErrMsg: ""
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
--Step7: [
this will still cause an error
as now the shell env is restored to venv0
which has got no AAA in it
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 0,
Output: "AAA=sourced_aaa",
ErrMsg: ""
})
})
cmd( 1):
env |grep AAA
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
--Step8: [
now let's restore to the point of venv1
which has got AAA in it
we expect the error is clear
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
--Step9: [
after sourcing, the env var: AAA exist
the error should be cleared
]
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
}),
"up_runtime_task_layer_number": 1
})
cmd( 1):
env |grep AAA
-
AAA=sourced_aaa
-
.. ok
. ok
params: name: the venv name action: snapshot | restore source: the source content srcfiles: a list of file to source
rules:
tasks:
- name: task
desc: |
please switch to use case1|case2 ...
the reason we do not chain all cases together is because
the venv will pollute the entire running session unless you mananage to restore it
task:
- func: call
do: case3
- name: case1
desc: ""
task:
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
case1: only source
source via the source content
do:
- name: virtualEnv
cmd:
source: |
echo "start of source"
export AAA=sourced_aaa
echo "end of source"
- func: shell
desc: |
after sourcing, the env var: AAA exist
do:
- env |grep AAA
- name: case2
desc: ""
task:
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
case2: only source
source via srcfile
do:
- name: virtualEnv
cmd:
srcfile: ./tests/functests/test_env.rc
- func: shell
desc: |
after sourcing, the env var: AAA exist
do:
- env |grep AAA
- name: case3
desc: ""
task:
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
no source/srcfile input
with name and action
now it will save current shell env
which has got no AAA in it
do:
- name: virtualEnv
cmd:
name: venv0
action: snapshot
- func: shell
desc: |
since there is no source, this will still cause an error
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
now source and save current shell environment variables
do:
- name: virtualEnv
cmd:
name: venv1
action: snapshot
srcfile: ./tests/functests/test_env.rc
- func: shell
desc: |
after sourcing, the env var: AAA exist
the error should be cleared
do:
- env |grep AAA
- func: cmd
desc: |
now let's restore to the point of venv0
which has got no AAA in it
do:
- name: virtualEnv
cmd:
name: venv0
action: restore
- func: shell
desc: |
this will still cause an error
as now the shell env is restored to venv0
which has got no AAA in it
do:
- env |grep AAA
flags:
- ignoreError
- func: cmd
desc: |
now let's restore to the point of venv1
which has got AAA in it
we expect the error is clear
do:
- name: virtualEnv
cmd:
name: venv1
action: restore
- func: shell
desc: |
after sourcing, the env var: AAA exist
the error should be cleared
do:
- env |grep AAA
- name: case4
desc: ""
task:
- func: cmd
desc: |
source via the source content
do:
- name: virtualEnv
cmd:
source: |
echo "start of source"
export AAA=sourced_aaa
echo "end of source"
- func: shell
desc: |
after sourcing, the env var: AAA exist
do:
- env |grep AAA
- func: cmd
desc: |
if you use clean param
it will unset all env vars from the current execution context
do:
- name: virtualEnv
cmd:
action: pure
- func: shell
desc: |
before sourcing, the env var: AAA does not exist
this will cause an error
do:
- env |grep AAA
flags:
- ignoreError
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0193
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/c0193
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: please switch to use case1|case2 ...
the reason we do not chain all cases together is because
the venv will pollute the entire running session unless you mananage to restore it
]
-Step1:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0
})
=Task4: [task ==> case3: ]
--Step1: [
before sourcing, the env var: AAA does not exist
this will cause an error
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1
})
cmd( 1):
env |grep AAA
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
--Step2: [
no source/srcfile input
with name and action
now it will save current shell env
which has got no AAA in it
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
--Step3: [
since there is no source, this will still cause an error
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
cmd( 1):
env |grep AAA
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
--Step4: [
now source and save current shell environment variables
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
start of source
end of source
--Step5: [
after sourcing, the env var: AAA exist
the error should be cleared
]
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
}),
"up_runtime_task_layer_number": 1
})
cmd( 1):
env |grep AAA
-
AAA=sourced_aaa
-
.. ok
. ok
--Step6: [
now let's restore to the point of venv0
which has got no AAA in it
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 0,
Output: "AAA=sourced_aaa",
ErrMsg: ""
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
--Step7: [
this will still cause an error
as now the shell env is restored to venv0
which has got no AAA in it
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 0,
Output: "AAA=sourced_aaa",
ErrMsg: ""
})
})
cmd( 1):
env |grep AAA
-
-
.. failed(suppressed if it is not the last step)
WARN: [ignoreError:] - [Error ignored!!!]
--Step8: [
now let's restore to the point of venv1
which has got AAA in it
we expect the error is clear
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 1,
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
})
})
~~SubStep1: [virtualEnv: ]
-sourcing execution result:
--Step9: [
after sourcing, the env var: AAA exist
the error should be cleared
]
self: final context exec vars:
(*core.Cache)({
"last_result": (*utils.ExecResult)({
Cmd: "env |grep AAA",
Code: 1,
Output: "",
ErrMsg: "exit status 1"
}),
"up_runtime_task_layer_number": 1
})
cmd( 1):
env |grep AAA
-
AAA=sourced_aaa
-
.. ok
. ok