From 0b784909336693189acf4b7fdd777814b792d68e Mon Sep 17 00:00:00 2001 From: Chris Kyrouac Date: Tue, 17 Sep 2024 13:07:32 -0400 Subject: [PATCH 1/3] tmt: Add TMT_PLUGINS env to tmt run invocation This is temporary while waiting for tmt to release the bootc provision plugin. Signed-off-by: Chris Kyrouac --- xtask/src/xtask.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xtask/src/xtask.rs b/xtask/src/xtask.rs index f53db37b..bc1a26b0 100644 --- a/xtask/src/xtask.rs +++ b/xtask/src/xtask.rs @@ -185,7 +185,10 @@ 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}").run() { + if let Err(e) = cmd!(sh, "tmt run plans -n {name}") + .env("TMT_PLUGINS", "./tests/plugins") + .run() + { // tmt annoyingly does not output errors by default let _ = cmd!(sh, "tmt run -l report -vvv").run(); return Err(e.into()); From 26e73f8e6b3bf1b925ac8744849f8acd98c51125 Mon Sep 17 00:00:00 2001 From: Chris Kyrouac Date: Tue, 17 Sep 2024 13:09:16 -0400 Subject: [PATCH 2/3] 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 bc1a26b0..1ebfb8ba 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() { From 355810f461a1d2f088b959964f7406d180d4ac89 Mon Sep 17 00:00:00 2001 From: Chris Kyrouac Date: Wed, 18 Sep 2024 07:45:48 -0400 Subject: [PATCH 3/3] tmt: Remove cached testcloud image before each test This is required for the bootc install tests that use a custom image. Otherwise, the cached image will be used instead of the image built from the bootc provision plugin. Signed-off-by: Chris Kyrouac --- xtask/src/xtask.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xtask/src/xtask.rs b/xtask/src/xtask.rs index 1ebfb8ba..df55e2ff 100644 --- a/xtask/src/xtask.rs +++ b/xtask/src/xtask.rs @@ -181,10 +181,10 @@ fn test_tmt(sh: &Shell) -> Result<()> { println!("Discovered plans: {all_plan_files:?}"); cmd!(sh, "cargo run -p tests-integration run-vm prepare-tmt").run()?; - // cc https://pagure.io/testcloud/pull-request/174 - cmd!(sh, "rm -vf /var/tmp/tmt/testcloud/images/disk.qcow2").run()?; for (_prio, name) in all_plan_files { + // cc https://pagure.io/testcloud/pull-request/174 + cmd!(sh, "rm -vf /var/tmp/tmt/testcloud/images/disk.qcow2").run()?; let verbose_enabled = std::env::var("TMT_VERBOSE") .ok() .and_then(|s| s.parse::().ok())