From 40f63482c4d32dd1f5af2e567556eac91aa327f0 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sun, 7 Oct 2012 15:11:20 +0100 Subject: [PATCH] CI: retry failed tests It's an unfortunate reality that PhantomJS does crash from time to time, and when you have over 500 tests running on 6 different rubies there is a high chance that at least on of those runs will fail. So hopefully this will help mitigate that. --- .gitignore | 1 + .rspec | 1 + .travis.yml | 1 + Rakefile | 2 ++ poltergeist.gemspec | 1 + 5 files changed, 6 insertions(+) create mode 100644 .rspec diff --git a/.gitignore b/.gitignore index 9746614..310a603 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /spec/support/custom_phantomjs_called /ci/Gemfile.*.lock /spec/tmp +/rspec.failures diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..e4d136b --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--format progress diff --git a/.travis.yml b/.travis.yml index 5855cb4..f01f1e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ before_script: - sudo ci/install_phantomjs - "export PATH=phantomjs/bin:$PATH" - phantomjs --version +script: rake ci rvm: - 1.9.3 - 1.9.2 diff --git a/Rakefile b/Rakefile index ce0aedb..9e2c524 100644 --- a/Rakefile +++ b/Rakefile @@ -4,6 +4,7 @@ require 'rspec/core/rake_task' base = File.dirname(__FILE__) require base + "/lib/capybara/poltergeist/version" require 'coffee-script' +require 'rspec-rerun' task :autocompile do system "guard" @@ -22,6 +23,7 @@ end RSpec::Core::RakeTask.new('test') task :default => [:compile, :test] +task :ci => 'rspec-rerun:spec' task :release do puts "Releasing #{Capybara::Poltergeist::VERSION}, y/n?" diff --git a/poltergeist.gemspec b/poltergeist.gemspec index 0f34dfc..b2481f2 100644 --- a/poltergeist.gemspec +++ b/poltergeist.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'image_size', '~> 1.0' s.add_development_dependency 'coffee-script', '~> 2.2.0' s.add_development_dependency 'guard-coffeescript', '~> 1.0.0' + s.add_development_dependency 'rspec-rerun', '~> 0.1' s.files = Dir.glob("{lib}/**/*") + %w(LICENSE README.md) s.require_path = 'lib'