-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add an initial feature for rerunning failing tests #895
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Feature: | ||
Rerun gives you a way to get through flaky tests usually pass after a few runs. | ||
This gives a development team a way forward other than disabling a valuable test. | ||
|
||
- Specify max rerun count in option | ||
- Output information to the screen | ||
- Output rerun information in test report | ||
|
||
Questions: | ||
use a tag for flaky tests? Global option to rerun any test that fails? | ||
|
||
Background: | ||
Given a flaky step definition | ||
|
||
Scenario: run a flaky test | ||
Given a file named "features/fail.feature" with: | ||
""" | ||
Feature: Fails | ||
|
||
Scenario: flaky test | ||
Given a flaky step | ||
|
||
""" | ||
When I run `cucumber features -q` | ||
Then it should fail with: | ||
""" | ||
Feature: Fails | ||
|
||
Scenario: flaky test | ||
Given a flaky step | ||
(RuntimeError) | ||
./features/step_definitions/steps.rb:4:in `flaky_pass' | ||
./features/step_definitions/steps.rb:1:in `/^a flaky step$/' | ||
features/fail.feature:4:in `Given a flaky step' | ||
|
||
Failing Scenarios: | ||
cucumber features/fail.feature:3 | ||
|
||
1 scenario (1 failed) | ||
1 step (1 failed) | ||
|
||
""" | ||
@wip | ||
Scenario: rerun a flaky test | ||
Given a file named "features/fail.feature" with: | ||
""" | ||
Feature: Fails | ||
|
||
Scenario: flaky test | ||
Given a flaky step | ||
|
||
""" | ||
When I run `cucumber features --rerun_flakes=1 -q` | ||
Then it should pass with: | ||
""" | ||
Feature: Fails | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe a |
||
Scenario: flaky test | ||
Given a flaky step | ||
(RuntimeError) | ||
./features/step_definitions/steps.rb:4:in `flaky_pass' | ||
./features/step_definitions/steps.rb:1:in `/^a flaky step$/' | ||
features/fail.feature:4:in `Given a flaky step' | ||
|
||
Failing Scenarios: | ||
cucumber features/fail.feature:3 | ||
|
||
1 scenario (1 passed, 1 flake) | ||
1 step (1 passed) | ||
|
||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to reproduce the Maven behaviour (which is what I suggest we start with) then we should just have a global option.