Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended environment variable control #5889

Closed
clebergnu opened this issue Mar 27, 2024 · 1 comment · Fixed by #5901
Closed

Extended environment variable control #5889

clebergnu opened this issue Mar 27, 2024 · 1 comment · Fixed by #5901
Assignees
Labels
customer:Passt Requirements/issues raised by the Passt project enhancement

Comments

@clebergnu
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Avocado's ``exec-test` test type turns its runnable's "kwarg" fields into environment variables. But, while that allows for some control of the executable's (that will be considered the test) environment, it fails to allow for instance to clear the environment variable.

There's also no way to clear all environment variables.

Describe the solution you'd like
There should be a way to determine that a exec-test's kwarg is actually a request to clear an environment variable. Also, there should be a global way of clearing all environment variables but the ones that are set.

Describe alternatives you've considered
Instead of doing this at the runnable's kwarg level, this could be handled at the spawner level, so that it'd be applicable to all test types. This seems to be more complex and the added value is not clear.

@clebergnu clebergnu added enhancement customer:Passt Requirements/issues raised by the Passt project labels Mar 27, 2024
@clebergnu clebergnu added this to the #105 - Codename TBD milestone Mar 27, 2024
@mr-avocado mr-avocado bot moved this to Triage in Default project Mar 27, 2024
@dgibson
Copy link
Contributor

dgibson commented Mar 27, 2024

Sounds like a good description of the problem to me. Fwiw, for our (passt's) purposes this is a nice-to-have, but in no way a blocker for starting implementing stuff.

@clebergnu clebergnu moved this from Triage to Short Term (Current Q) Backlog in Default project Apr 8, 2024
@richtja richtja self-assigned this Apr 8, 2024
@richtja richtja moved this from Short Term (Current Q) Backlog to In progress in Default project Apr 9, 2024
richtja added a commit to richtja/avocado that referenced this issue Apr 11, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `NULL` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 11, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the AVOCADO_CLEAR_ENV to `TRUE` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 11, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `NULL` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 11, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the AVOCADO_CLEAR_ENV to `TRUE` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
@richtja richtja linked a pull request Apr 11, 2024 that will close this issue
richtja added a commit to richtja/avocado that referenced this issue Apr 16, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `None` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 16, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the AVOCADO_CLEAR_ENV to `TRUE` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 16, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the AVOCADO_CLEAR_ENV to `TRUE` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 17, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `None` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 17, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the AVOCADO_CLEAR_ENV to `TRUE` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 23, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `None` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 23, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the runner.exectest.clear_env to `true`
in tests config.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 25, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `None` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 25, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the runner.exectest.clear_env to
`system` or `all` in tests config.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 26, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to disable env variable during
the test runtime so it won't be available to test script. Only thing
which user needs to do is to set the variable to `None` in test
`kwargs`.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 26, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the runner.exectest.clear_env to
`system` or `all` in tests config.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
richtja added a commit to richtja/avocado that referenced this issue Apr 26, 2024
This commit adds more control over the environment variables in
exec-tests for users. It brings a way how to clear the test environment
during the test runtime so it won't affect the test script. Only thing
which user needs to do is to set the runner.exectest.clear_env to
`system` or `all` in tests config.

Reference: avocado-framework#5889
Signed-off-by: Jan Richter <[email protected]>
@github-project-automation github-project-automation bot moved this from In progress to Done 105 in Default project Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer:Passt Requirements/issues raised by the Passt project enhancement
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants