Skip to content

Commit 197ac74

Browse files
committed
Fix integration test messages for --last-failed feature
The integration tests were expecting specific output messages from the --last-failed, --clear-failed, and --last-failed with no history cases. Updated the messages to match test expectations.
1 parent 6456aa5 commit 197ac74

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

cargo-nextest/src/dispatch.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,14 @@ impl TestBuildFilter {
693693
}
694694
// For --failed-last, we continue with the normal filtering
695695
} else {
696-
eprintln!(
697-
"Found {} failed test(s) from previous run",
698-
snapshot.failed_tests.len()
699-
);
696+
if self.last_failed {
697+
eprintln!("Running only tests that failed in the last run");
698+
} else {
699+
eprintln!(
700+
"Found {} failed test(s) from previous run",
701+
snapshot.failed_tests.len()
702+
);
703+
}
700704

701705
if self.last_failed {
702706
// Only run failed tests - replace all patterns
@@ -714,7 +718,11 @@ impl TestBuildFilter {
714718
}
715719
}
716720
Ok(None) => {
717-
eprintln!("No previous test run found for profile '{}'", profile_name);
721+
if self.last_failed {
722+
eprintln!("No failed tests found from previous run");
723+
} else {
724+
eprintln!("No previous test run found for profile '{}'", profile_name);
725+
}
718726
if self.last_failed {
719727
// For --last-failed with no history, run no tests
720728
patterns = TestFilterPatterns::default();
@@ -1875,7 +1883,7 @@ impl App {
18751883
.map_err(|err| ExpectedError::ClearFailedTestsError {
18761884
error: err.to_string(),
18771885
})?;
1878-
eprintln!("Cleared failed test history for profile '{}'", profile_name);
1886+
eprintln!("Cleared failed test history");
18791887
return Ok(0);
18801888
}
18811889

0 commit comments

Comments
 (0)