From 26e73f8e6b3bf1b925ac8744849f8acd98c51125 Mon Sep 17 00:00:00 2001 From: Chris Kyrouac Date: Tue, 17 Sep 2024 13:09:16 -0400 Subject: [PATCH] tmt: Add TMT_VERBOSE env var 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 --- xtask/src/xtask.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xtask/src/xtask.rs b/xtask/src/xtask.rs index bc1a26b0f..1ebfb8bae 100644 --- a/xtask/src/xtask.rs +++ b/xtask/src/xtask.rs @@ -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::().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() {