Skip to content

Commit

Permalink
Merge pull request #791 from ckyrouac/more-lbi-tests2
Browse files Browse the repository at this point in the history
TMT test tweaks
  • Loading branch information
cgwalters committed Sep 18, 2024
2 parents c173970 + 355810f commit 3d36c9b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,25 @@ 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 {
if let Err(e) = cmd!(sh, "tmt run plans -n {name}").run() {
// 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::<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()
{
// tmt annoyingly does not output errors by default
let _ = cmd!(sh, "tmt run -l report -vvv").run();
return Err(e.into());
Expand Down

0 comments on commit 3d36c9b

Please sign in to comment.