lib/parallel_tests/tasks.rb in parallel_tests-0.8.14 vs lib/parallel_tests/tasks.rb in parallel_tests-0.9.0
- old
+ new
@@ -106,21 +106,28 @@
ParallelTests::Tasks.run_in_parallel("rake db:seed RAILS_ENV=#{ParallelTests::Tasks.rails_env}", args)
end
['test', 'spec', 'features'].each do |type|
desc "run #{type} in parallel with parallel:#{type}[num_cpus]"
- task type, [:count, :pattern, :options] do |t,args|
+ task type, [:count, :pattern, :options] do |t, args|
ParallelTests::Tasks.check_for_pending_migrations
+
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..'))
require "parallel_tests"
+
count, pattern, options = ParallelTests::Tasks.parse_args(args)
test_framework = {
'spec' => 'rspec',
'test' => 'test',
'features' => 'cucumber'
}[type]
+
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallel_test')
- command = "#{executable} #{type} --type #{test_framework} -n #{count} -p '#{pattern}' -o '#{options}'"
+ command = "#{executable} #{type} --type #{test_framework} " \
+ "-n #{count} " \
+ "--pattern '#{pattern}' " \
+ "--test-options '#{options}'"
+
abort unless system(command) # allow to chain tasks e.g. rake parallel:spec parallel:features
end
end
end