about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2018-04-21 02:31:30 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-04-20 19:31:30 +0200
commitb4382247515728521275002643e4d1b7360bf7fb (patch)
tree7434ffa4feae56e2ace94a17d6ef3f3d13d8bcd6
parent84214b864c63aee08357a719ab386b8e4ed5b901 (diff)
Introduce rspec-retry (#7206)
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock3
-rw-r--r--spec/spec_helper.rb8
3 files changed, 12 insertions, 0 deletions
diff --git a/Gemfile b/Gemfile
index efafe295c..8055f1561 100644
--- a/Gemfile
+++ b/Gemfile
@@ -111,6 +111,7 @@ group :test do
   gem 'microformats', '~> 4.0'
   gem 'rails-controller-testing', '~> 1.0'
   gem 'rspec-sidekiq', '~> 3.0'
+  gem 'rspec-retry', '~> 0.5', require: false
   gem 'simplecov', '~> 0.14', require: false
   gem 'webmock', '~> 3.3'
   gem 'parallel_tests', '~> 2.21'
diff --git a/Gemfile.lock b/Gemfile.lock
index e799533ae..eeb4bf17e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -495,6 +495,8 @@ GEM
       rspec-expectations (~> 3.7.0)
       rspec-mocks (~> 3.7.0)
       rspec-support (~> 3.7.0)
+    rspec-retry (0.5.7)
+      rspec-core (> 3.3)
     rspec-sidekiq (3.0.3)
       rspec-core (~> 3.0, >= 3.0.0)
       sidekiq (>= 2.4.0)
@@ -715,6 +717,7 @@ DEPENDENCIES
   redis-rails (~> 5.0)
   rqrcode (~> 0.10)
   rspec-rails (~> 3.7)
+  rspec-retry (~> 0.5)
   rspec-sidekiq (~> 3.0)
   rubocop
   ruby-oembed (~> 0.12)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a0466dd4b..66ac75ee0 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,4 @@
+require 'rspec/retry'
 require 'simplecov'
 
 GC.disable
@@ -11,6 +12,9 @@ end
 gc_counter = -1
 
 RSpec.configure do |config|
+  config.verbose_retry = true
+  config.display_try_failure_messages = true
+
   config.expect_with :rspec do |expectations|
     expectations.include_chain_clauses_in_custom_matcher_descriptions = true
   end
@@ -25,6 +29,10 @@ RSpec.configure do |config|
     end
   end
 
+  config.around :each do |ex|
+    ex.run_with_retry retry: 3
+  end
+
   config.before :suite do
     Chewy.strategy(:bypass)
   end