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

exec-test: allow setting of the working directory #5937

Open clebergnu opened 1 month ago

clebergnu commented 1 month ago

Is your feature request related to a problem? Please describe. The exec-test test type allows users to run an executable given by absolute path, or more commonly by relative path. In both cases, the current working directory inherited by Avocado or the specific test runner (say avocado-runner-exec-test) may not be appropriate to the executable.

One common situation is when using an executable that will depend on files located somewhere else in the filesystem. For instance, having a runnable's uri of make, together with a make target as an argument given to args, will depend on the location of the Makefile containing that target.

The goal here is to implement a way to control how exec-tests can set their current working directory, so that use cases such as make <target> can be defined with uri and args in a way that makes the execution relocatable (that is, does not depend on running from a specific location).

Describe the solution you'd like A configuration option such as runner.exectest.cwd can take a number of options that will control the current working for the executables themselves. For instance:

Describe alternatives you've considered None.

Additional information None