-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Only use rspec-retry when environment variable is set
So that we can disable it in our CI (CircleCI & Travis) but keep it enabled in our package builds. This way we can sport flaky tests but does not interrupt the package builds.
- Loading branch information
Showing
3 changed files
with
23 additions
and
19 deletions.
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
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
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,20 @@ | ||
require 'rspec/retry' | ||
RSpec.configure do |config| | ||
# show retry status in spec process | ||
config.verbose_retry = true | ||
# show exception that triggers a retry if verbose_retry is set to true | ||
config.display_try_failure_messages = true | ||
|
||
# run retry only on features | ||
config.around :each, :js do |ex| | ||
ex.run_with_retry retry: 3 | ||
end | ||
|
||
# callback to be run between retries | ||
config.retry_callback = proc do |ex| | ||
# run some additional clean up task - can be filtered by example metadata | ||
if ex.metadata[:js] | ||
Capybara.reset! | ||
end | ||
end | ||
end |