Skip to content

Commit 8a4dc35

Browse files
authored
ci: add rspec-retry (#132)
Integration tests are flaky.. make sure they are retried a few times before returning an error.
1 parent d3a75d6 commit 8a4dc35

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ group :test do
77
gem 'pry-byebug'
88
gem 'rake', '~> 12.3.3'
99
gem 'rspec'
10+
gem 'rspec-retry'
1011
gem 'vimrunner'
1112
end

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ GEM
2424
rspec-mocks (3.8.0)
2525
diff-lcs (>= 1.2.0, < 2.0)
2626
rspec-support (~> 3.8.0)
27+
rspec-retry (0.6.2)
28+
rspec-core (> 3.3)
2729
rspec-support (3.8.0)
2830
vimrunner (0.3.4)
2931

@@ -35,6 +37,7 @@ DEPENDENCIES
3537
pry-byebug
3638
rake (~> 12.3.3)
3739
rspec
40+
rspec-retry
3841
vimrunner
3942

4043
BUNDLED WITH

spec/spec_helper.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'vimrunner'
44
require 'vimrunner/rspec'
55
require 'securerandom'
6+
require 'rspec/retry'
67

78
Vimrunner::RSpec.configure do |config|
89
# Use a single Vim instance for the test suite. Set to false to use an
@@ -27,6 +28,21 @@
2728
end
2829

2930
RSpec.configure do |config|
31+
32+
# RSpec Retry
33+
# ===========
34+
# show retry status in spec process
35+
config.verbose_retry = true
36+
37+
# show exception that triggers a retry if verbose_retry is set to true
38+
config.display_try_failure_messages = true
39+
40+
# retry each spec 3 times
41+
config.around :each do |ex|
42+
ex.run_with_retry retry: 3
43+
end
44+
# ============
45+
3046
config.around do |example|
3147
Dir.mktmpdir do |dir|
3248
Dir.chdir(dir) do

0 commit comments

Comments
 (0)