summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-11-12 10:52:20 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-11-12 12:17:31 +0100
commit9d3734737c9c27e89a10b8925197673dd4e117ba (patch)
tree90946315e1441d412ff44fbc18ffbb16377d48fd
parent8ab5df9d872414b2cca3ebd16d57b89e2f19e06a (diff)
downloadgitlab-ce-retry-tests.tar.gz
Retry failed testsretry-tests
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock3
-rw-r--r--spec/spec_helper.rb4
4 files changed, 13 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 128faa07db8..0ecd7e320e8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,9 +7,13 @@ before_script:
- cp config/gitlab.yml.example config/gitlab.yml
- touch log/application.log
- touch log/test.log
- - bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
+ - bundle install --without postgres production --jobs $(nproc) --retry 5 "${FLAGS[@]}"
- bundle exec rake db:create RAILS_ENV=test
+variables:
+ # retry tests only in CI environment
+ RSPEC_RETRY_RETRY_COUNT: "3"
+
spec:feature:
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
diff --git a/Gemfile b/Gemfile
index 8a19885bcb1..e364718ed42 100644
--- a/Gemfile
+++ b/Gemfile
@@ -236,6 +236,7 @@ group :development, :test do
gem 'database_cleaner', '~> 1.4.0'
gem 'factory_girl_rails', '~> 4.3.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 99cdc2a50ae..71858e65887 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -597,6 +597,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.28.0)
astrolabe (~> 1.3)
@@ -896,6 +898,7 @@ DEPENDENCIES
rerun (~> 0.10.0)
rqrcode-rails3 (~> 0.1.7)
rspec-rails (~> 3.3.0)
+ rspec-retry
rubocop (~> 0.28.0)
ruby-fogbugz (~> 0.2.1)
sanitize (~> 2.0)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2be13bb3e6a..ee40a544568 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