Skip to content

Commit 6749e1b

Browse files
authored
Merge pull request #116 from cedarcode/rm/allow-to-retry-tests
Allow to retry tests in CI
2 parents 559db4c + 4f6b51b commit 6749e1b

10 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,4 @@ jobs:
8282
bundler-cache: true
8383

8484
- name: Run tests
85-
run: |
86-
bundle exec rspec
85+
run: bundle exec rspec

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ gem "pry-byebug", "~> 3.11"
1717
gem "puma", "~> 6.6"
1818
gem "rails", "~> 8.0"
1919
gem "rspec-rails", "~> 8.0"
20+
gem "rspec-retry"
2021
gem "rubocop", "~> 1.79"
2122
gem "rubocop-rails", "~> 2.32"
2223
gem "rubocop-rspec", "~> 3.6"

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ GEM
266266
rspec-expectations (~> 3.13)
267267
rspec-mocks (~> 3.13)
268268
rspec-support (~> 3.13)
269+
rspec-retry (0.6.2)
270+
rspec-core (> 3.3)
269271
rspec-support (3.13.4)
270272
rubocop (1.79.1)
271273
json (~> 2.3)
@@ -351,6 +353,7 @@ DEPENDENCIES
351353
puma (~> 6.6)
352354
rails (~> 8.0)
353355
rspec-rails (~> 8.0)
356+
rspec-retry
354357
rubocop (~> 1.79)
355358
rubocop-rails (~> 2.32)
356359
rubocop-rspec (~> 3.6)

gemfiles/devise_5_0.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem "pry-byebug", "~> 3.10"
1212
gem "puma", "~> 6.6"
1313
gem "rails", ">= 7.1"
1414
gem "rspec-rails", ">= 7.1"
15+
gem "rspec-retry"
1516
gem "rubocop", "~> 1.79"
1617
gem "rubocop-rails", "~> 2.32"
1718
gem "rubocop-rspec", "~> 3.6"

gemfiles/rails_7_1.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem "pry-byebug", "~> 3.10"
1212
gem "puma", "~> 6.6"
1313
gem "rails", "~> 7.1.x"
1414
gem "rspec-rails", "~> 7.1"
15+
gem "rspec-retry"
1516
gem "rubocop", "~> 1.79"
1617
gem "rubocop-rails", "~> 2.32"
1718
gem "rubocop-rspec", "~> 3.6"

gemfiles/rails_7_2.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem "pry-byebug", "~> 3.11"
1212
gem "puma", "~> 6.6"
1313
gem "rails", "~> 7.2.x"
1414
gem "rspec-rails", "~> 8.0"
15+
gem "rspec-retry"
1516
gem "rubocop", "~> 1.79"
1617
gem "rubocop-rails", "~> 2.32"
1718
gem "rubocop-rspec", "~> 3.6"

gemfiles/rails_8_0.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem "pry-byebug", "~> 3.11"
1212
gem "puma", "~> 6.6"
1313
gem "rails", "~> 8.0.x"
1414
gem "rspec-rails", "~> 8.0"
15+
gem "rspec-retry"
1516
gem "rubocop", "~> 1.79"
1617
gem "rubocop-rails", "~> 2.32"
1718
gem "rubocop-rspec", "~> 3.6"

gemfiles/rails_8_1.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem "pry-byebug", "~> 3.11"
1212
gem "puma", "~> 6.6"
1313
gem "rails", "~> 8.1.x"
1414
gem "rspec-rails", "~> 8.0"
15+
gem "rspec-retry"
1516
gem "rubocop", "~> 1.79"
1617
gem "rubocop-rails", "~> 2.32"
1718
gem "rubocop-rspec", "~> 3.6"

gemfiles/rails_edge.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem "pry-byebug", "~> 3.11"
1212
gem "puma", "~> 6.6"
1313
gem "rails", branch: "main", git: "https://github.com/rails/rails"
1414
gem "rspec-rails", "~> 8.0"
15+
gem "rspec-retry"
1516
gem "rubocop", "~> 1.79"
1617
gem "rubocop-rails", "~> 2.32"
1718
gem "rubocop-rspec", "~> 3.6"

spec/spec_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
end
1414

1515
require "rspec/rails"
16+
require "rspec/retry"
1617
require "capybara/rspec"
1718

1819
RSpec.configure do |config|
@@ -48,4 +49,10 @@
4849
config.include Devise::Test::IntegrationHelpers, type: :system
4950
config.include Devise::Test::IntegrationHelpers, type: :request
5051
config.include Devise::Webauthn::Test::AuthenticatorHelpers, type: :system
52+
53+
config.verbose_retry = true
54+
config.display_try_failure_messages = true
55+
config.around :each, type: :system do |ex|
56+
ex.run_with_retry retry: 3
57+
end
5158
end

0 commit comments

Comments
 (0)