summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-11-12 10:52:20 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-03-09 14:21:19 +0100
commit640bf8ab7212988fda0189e1534d46dcbf0c126f (patch)
treeb75520ff4399df7339e4f19e3b02406abc7c9880
parent500337c4b23700a30876c6d2f8e7c612f8114432 (diff)
downloadgitlab-ce-640bf8ab7212988fda0189e1534d46dcbf0c126f.tar.gz
Retry failed tests
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock3
-rw-r--r--spec/spec_helper.rb4
4 files changed, 10 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c477721f9da..f77b5bdc955 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,6 +12,8 @@ cache:
variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
+ # retry tests only in CI environment
+ RSPEC_RETRY_RETRY_COUNT: "3"
before_script:
- source ./scripts/prepare_build.sh
diff --git a/Gemfile b/Gemfile
index c66ef3cffad..a5c244fb7b6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -263,6 +263,7 @@ group :development, :test do
gem 'database_cleaner', '~> 1.4.0'
gem 'factory_girl_rails', '~> 4.6.0'
gem 'rspec-rails', '~> 3.3.0'
+ gem 'rspec-retry'
gem 'spinach-rails', '~> 0.2.1'
# Prevent occasions where minitest is not bundled in packaged versions of ruby (see #3826)
diff --git a/Gemfile.lock b/Gemfile.lock
index 22c86e4ae8f..7f3c5911e5f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -679,6 +679,8 @@ GEM
rspec-expectations (~> 3.3.0)
rspec-mocks (~> 3.3.0)
rspec-support (~> 3.3.0)
+ rspec-retry (0.4.5)
+ rspec-core
rspec-support (3.3.0)
rubocop (0.35.1)
astrolabe (~> 1.3)
@@ -999,6 +1001,7 @@ DEPENDENCIES
rouge (~> 1.10.1)
rqrcode-rails3 (~> 0.1.7)
rspec-rails (~> 3.3.0)
+ rspec-retry
rubocop (~> 0.35.0)
ruby-fogbugz (~> 0.2.1)
sanitize (~> 2.0)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 8f381f46e57..159fb964171 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -15,6 +15,7 @@ require 'rspec/rails'
require 'shoulda/matchers'
require 'sidekiq/testing/inline'
require 'benchmark/ips'
+require 'rspec/retry'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
@@ -25,6 +26,9 @@ RSpec.configure do |config|
config.use_instantiated_fixtures = false
config.mock_with :rspec
+ config.verbose_retry = true
+ config.display_try_failure_messages = true
+
config.include Devise::TestHelpers, type: :controller
config.include LoginHelpers, type: :feature
config.include LoginHelpers, type: :request