Maintenance: Backport rspec-retry to stabilize Capybara tests.
This commit is contained in:
parent
85649f8894
commit
e50ba0aca5
4 changed files with 17 additions and 1 deletions
1
Gemfile
1
Gemfile
|
@ -172,6 +172,7 @@ group :development, :test do
|
||||||
# test frameworks
|
# test frameworks
|
||||||
gem 'rails-controller-testing'
|
gem 'rails-controller-testing'
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
|
gem 'rspec-retry'
|
||||||
gem 'shoulda-matchers'
|
gem 'shoulda-matchers'
|
||||||
gem 'test-unit'
|
gem 'test-unit'
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,8 @@ GEM
|
||||||
rspec-expectations (~> 3.10)
|
rspec-expectations (~> 3.10)
|
||||||
rspec-mocks (~> 3.10)
|
rspec-mocks (~> 3.10)
|
||||||
rspec-support (~> 3.10)
|
rspec-support (~> 3.10)
|
||||||
|
rspec-retry (0.6.2)
|
||||||
|
rspec-core (> 3.3)
|
||||||
rspec-support (3.11.0)
|
rspec-support (3.11.0)
|
||||||
rszr (0.5.2)
|
rszr (0.5.2)
|
||||||
rubocop (1.26.0)
|
rubocop (1.26.0)
|
||||||
|
@ -673,6 +675,7 @@ DEPENDENCIES
|
||||||
rchardet (>= 1.8.0)
|
rchardet (>= 1.8.0)
|
||||||
redis
|
redis
|
||||||
rspec-rails
|
rspec-rails
|
||||||
|
rspec-retry
|
||||||
rszr (= 0.5.2)
|
rszr (= 0.5.2)
|
||||||
rubocop
|
rubocop
|
||||||
rubocop-faker
|
rubocop-faker
|
||||||
|
|
|
@ -61,7 +61,8 @@ RSpec.configure do |config|
|
||||||
# WebMock makes it impossible to have persistent http connections to Selenium,
|
# WebMock makes it impossible to have persistent http connections to Selenium,
|
||||||
# which may cause overhead and Net::OpenTimeout errors.
|
# which may cause overhead and Net::OpenTimeout errors.
|
||||||
WebMock.disable! if !use_vcr
|
WebMock.disable! if !use_vcr
|
||||||
example.run
|
# rspec-retry
|
||||||
|
example.run_with_retry retry: 3, exceptions_to_retry: [Net::OpenTimeout, Net::ReadTimeout]
|
||||||
WebMock.enable! if !use_vcr
|
WebMock.enable! if !use_vcr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
11
spec/support/rspec_retry.rb
Normal file
11
spec/support/rspec_retry.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
||||||
|
|
||||||
|
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
|
||||||
|
# The list of exceptions to fail on should be configured in the individual :run_with_retry calls.
|
||||||
|
end
|
Loading…
Reference in a new issue