Skip to content
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

Make --fail-fast play nice with --retry #1283

Merged
merged 3 commits into from
Apr 21, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions features/docs/cli/retry_failing_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ Feature: Retry failing tests
"""


3 scenarios (2 flaky, 1 passed)
"""

@todo-windows
Scenario: Flaky scenarios gives exit code zero in non-strict mode even when failing fast
When I run `cucumber -q --retry 2 --fail-fast --format summary`
Then it should pass with:
"""


3 scenarios (2 flaky, 1 passed)
"""

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/fail_fast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FailFast
def initialize(configuration)
configuration.on_event :test_case_finished do |event|
_test_case, result = *event.attributes
Cucumber.wants_to_quit = true unless result.ok?(configuration.strict)
Cucumber.wants_to_quit = !result.ok?(configuration.strict)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Cucumber.wants_to_quit is global and may be set to true by other components than the FailFast formatter, I think that it should only set Cucumber.wants_to_quit to false when it is sure that it is a flaky test that have passed.

end
end
end
Expand Down