Skip to content

Commit

Permalink
Summarize the names of the failing tests at the bottom of the test ru…
Browse files Browse the repository at this point in the history
…nner (FuelLabs#3550)

Co-authored-by: emilyaherbert <[email protected]>
  • Loading branch information
emilyaherbert and emilyaherbert authored Dec 9, 2022
1 parent edd77fb commit df39d4a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/src/e2e_vm_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,11 @@ pub async fn run(filter_config: &FilterConfig, run_config: &RunConfig) -> Result
};
let mut number_of_tests_executed = 0;
let mut number_of_tests_failed = 0;
let mut failed_tests = vec![];

for (i, test) in tests.into_iter().enumerate() {
print!("Testing {} ...", test.name.bold());
let name = test.name.clone();
print!("Testing {} ...", name.clone().bold());
stdout().flush().unwrap();

let mut output = String::new();
Expand All @@ -365,6 +367,7 @@ pub async fn run(filter_config: &FilterConfig, run_config: &RunConfig) -> Result
println!("{}", textwrap::indent(err.to_string().as_str(), " "));
println!("{}", textwrap::indent(&output, " "));
number_of_tests_failed += 1;
failed_tests.push(name);
} else {
println!(" {}", "ok".green().bold());

Expand Down Expand Up @@ -420,6 +423,17 @@ pub async fn run(filter_config: &FilterConfig, run_config: &RunConfig) -> Result
number_of_tests_failed,
disabled_tests.len()
);
if number_of_tests_failed > 0 {
tracing::info!("{}", "Failing tests:".red().bold());
tracing::info!(
" {}",
failed_tests
.into_iter()
.map(|test_name| format!("{} ... {}", test_name.bold(), "failed".red().bold()))
.collect::<Vec<_>>()
.join("\n ")
);
}
}
if number_of_tests_failed != 0 {
Err(anyhow::Error::msg("Failed tests"))
Expand Down

0 comments on commit df39d4a

Please sign in to comment.