swupd-client icon indicating copy to clipboard operation
swupd-client copied to clipboard

Testlib: Export the test environment name as environment variable

Open castulo opened this issue 5 years ago • 0 comments

Many functions in the test library require the name of the test environment to be provided as an argument of the function. This was initially designed this way to enable the use of multiple environments at the same time from the terminal. However we can just as easily export this variable as an environment variable so we can remove that argument from all those functions making the functions easier to use.

This make more sense from the perspective of a test since a test is always running within the same test environment.

And if the commands are required to be run from the terminal for debugging purposes we can still use multiple environments passing the environment variable for each command in the terminal. For example:

ENV_NAME=my_env1 create_bundle -n bundle1 -f /foo/bar
ENV_NAME=my_env2 create_bundle -n bundle1 -f /foo/bar

castulo avatar Apr 20 '20 19:04 castulo