avocado-framework / avocado

Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native tests are written in Python and they follow the unittest pattern, but any executable can serve as a test.
https://avocado-framework.github.io/
Other
336 stars 335 forks source link

Extended environment variable control #5889

Closed clebergnu closed 2 months ago

clebergnu commented 3 months ago

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.

dgibson commented 3 months ago

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.