tmt icon indicating copy to clipboard operation
tmt copied to clipboard

RFE: environment should be also confgigurable from CMD line

Open jscotka opened this issue 5 years ago • 2 comments

as https://tmt.readthedocs.io/en/stable/spec/plans.html#environment is possible to add more env variables to test execution and it is on same level as other steps. I know that it is not step, but I expect that also cmd line would have also possible to do something like:

tmt run -a environment -var "KEY=value" ...

jscotka avatar Mar 26 '21 09:03 jscotka

closing as there exists --environment for tmt run

jscotka avatar Mar 26 '21 11:03 jscotka

As there exists command line opts, probably it would be nice to improve it inside doc, I can imagine that in FMF specification, for items like https://tmt.readthedocs.io/en/stable/spec/plans.html#environment could be mentioned how to override/append this via command line.

as I searched for this option in tmt run execute/prepare --help where I expect this to be defined. probably define it inside run level is fine, but does that means that this ENV var is passed also e.g. when I've use tmt run -e "VAR=hello" -a prepare -s echo $VAR

jscotka avatar Mar 26 '21 11:03 jscotka

As there exists command line opts, probably it would be nice to improve it inside doc, I can imagine that in FMF specification, for items like https://tmt.readthedocs.io/en/stable/spec/plans.html#environment could be mentioned how to override/append this via command line.

This part should be already covered in the docs:

# Variables from the command line
tmt run --environment X=1 --environment Y=2
tmt run --environment "X=1 Y=2"

as I searched for this option in tmt run execute/prepare --help where I expect this to be defined. probably define it inside run level is fine, but does that means that this ENV var is passed also e.g. when I've use tmt run -e "VAR=hello" -a prepare -s echo $VAR

Yeah, I believe the environment area would definitely deserve a separate section in the Guide, now that the environment key has been implemented under the provision key the precedence is even a bit more complicated. Let's clarify that in a new Environment section.

psss avatar Aug 12 '25 08:08 psss

Added to the backlog with should priority.

psss avatar Aug 12 '25 08:08 psss