Skip to content

Commit

Permalink
tmt: Add TMT_VERBOSE env var
Browse files Browse the repository at this point in the history
1 -> enabled. This adds -vvvvv to the tmt run invocation when using
`make test-tmt` to stream detailed test run output.

Signed-off-by: Chris Kyrouac <[email protected]>
  • Loading branch information
ckyrouac committed Sep 17, 2024
1 parent 0b78490 commit 26e73f8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,18 @@ fn test_tmt(sh: &Shell) -> Result<()> {
cmd!(sh, "rm -vf /var/tmp/tmt/testcloud/images/disk.qcow2").run()?;

for (_prio, name) in all_plan_files {
if let Err(e) = cmd!(sh, "tmt run plans -n {name}")
let verbose_enabled = std::env::var("TMT_VERBOSE")
.ok()
.and_then(|s| s.parse::<u32>().ok())
.unwrap_or(0);

let verbose = if verbose_enabled == 1 {
Some("-vvvvv".to_string())
} else {
None
};

if let Err(e) = cmd!(sh, "tmt {verbose...} run plans -n {name}")
.env("TMT_PLUGINS", "./tests/plugins")
.run()
{
Expand Down

0 comments on commit 26e73f8

Please sign in to comment.