Skip to content

Commit

Permalink
Introduce parallel tests.
Browse files Browse the repository at this point in the history
This also removes the rake tasks and formatter stuff that aren't needed
as much any more.
  • Loading branch information
steveklabnik committed May 21, 2014
1 parent febf0ff commit addb9fb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,4 +1,4 @@
language: ruby language: ruby
rvm: rvm:
- 2.0.0 - 2.0.0
script: bin/rake cruise script: bin/rake cucumber
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -5,3 +5,5 @@ gem "httparty"
gem "json-schema" gem "json-schema"
gem "uri_template" gem "uri_template"
gem "rake" gem "rake"

gem "parallel_tests"
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -19,6 +19,9 @@ GEM
multi_json (1.8.2) multi_json (1.8.2)
multi_test (0.0.2) multi_test (0.0.2)
multi_xml (0.5.5) multi_xml (0.5.5)
parallel (1.0.0)
parallel_tests (0.16.10)
parallel
rake (10.1.0) rake (10.1.0)
uri_template (0.6.0) uri_template (0.6.0)


Expand All @@ -29,5 +32,6 @@ DEPENDENCIES
cucumber cucumber
httparty httparty
json-schema json-schema
parallel_tests
rake rake
uri_template uri_template
37 changes: 1 addition & 36 deletions Rakefile
@@ -1,11 +1,5 @@
require 'cucumber/rake/task' require 'cucumber/rake/task'

require 'parallel_tests/tasks'
class BuildFailure < Exception;
def initialize(message = nil)
message ||= "Build failed"
super(message)
end
end;


Cucumber::Rake::Task.new do |t| Cucumber::Rake::Task.new do |t|
t.cucumber_opts = "--format progress --tags ~@failing" t.cucumber_opts = "--format progress --tags ~@failing"
Expand All @@ -20,33 +14,4 @@ namespace :features do
Cucumber::Rake::Task.new(:all) do |t| Cucumber::Rake::Task.new(:all) do |t|
t.cucumber_opts = "--format progress" t.cucumber_opts = "--format progress"
end end

desc "Run in-progress features"
Cucumber::Rake::Task.new(:in_progress) do |t|
t.cucumber_opts = "--require formatters/ --format Cucumber::Formatter::InProgress --tags @failing"
end
end

desc "Run complete feature build"
task :cruise do
finished_successful = run_and_check_for_exception("cucumber")
in_progress_successful = run_and_check_for_exception("features:in_progress")

unless finished_successful && in_progress_successful
puts
puts("Finished features had failing steps") unless finished_successful
puts("In-progress Scenario/s passed when they should fail or be pending") unless in_progress_successful
puts
raise BuildFailure
end
end

def run_and_check_for_exception(task_name)
puts "*** Running #{task_name} features ***"
begin
Rake::Task["#{task_name}"].invoke
rescue Exception => e
return false
end
true
end end
60 changes: 0 additions & 60 deletions formatters/in_progress.rb

This file was deleted.

0 comments on commit addb9fb

Please sign in to comment.