-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Labels
enhancementImprovement of existing features or bugfixImprovement of existing features or bugfix
Milestone
Description
I was wondering if it's something that we can add to the framework. We already have a function to repeat failed tests output but we don't have a function to run failed tests again. It's common to have flaky tests that sometimes can be solved by running them again.
For example :
#[tokio::main]
async fn main() {
AnimalWorld::cucumber()
.replay_failed(2)
.run_and_exit("tests/features/book/output/terminal_repeat_failed.feature")
.await;
}
Where 2 is the maximum number of times the tests should be run again in case of test failures. Let's say we have the tests A, B, C and D :
- During the first run only
Apasses - Then
B,CandDare run again (1 replay left if we have new test failures) - Only B passes, we run again
CandD(0 replay left) Dfails again, this one is certainly more than just unstable
Regarding the output we have two choices :
- Print all test executions : it's transparent but can be repetitive when the tests fail multiple times (like
Din this example) - Or just print the result once the last replay is done (which can be the maximum, here
2, or a previous run if all tests are passing)
Metadata
Metadata
Assignees
Labels
enhancementImprovement of existing features or bugfixImprovement of existing features or bugfix