Revert "update para exclude rake tasks to use parallelized runtime"

This reverts commit 4c0f8d44a6

Change-Id: I26913b2533dd18f750a81fb3f08c234839d508ad
Reviewed-on: https://gerrit.instructure.com/19480
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
This commit is contained in:
Bryan Madsen 2013-04-10 15:54:25 +00:00
parent 88d271609b
commit 9d129a94e4
3 changed files with 15 additions and 6 deletions

View File

@ -109,7 +109,7 @@ end
group :test do
gem 'bluecloth', '2.0.10' # for generating api docs
gem 'mocha', :git => 'git://github.com/ccutrer/mocha.git', :require => false
gem 'parallelized_specs', '0.4.50'
gem 'parallelized_specs', '0.4.42'
gem 'rcov', '0.9.9'
if CANVAS_RAILS3
gem 'rspec-rails', '2.13.0'

View File

@ -1,20 +1,23 @@
# Don't load rspec if running "rake gems:*"
unless ARGV.any? { |a| a =~ /\Agems/ }
namespace :parallel do
task :nonselenium, :count do |t, args|
task :nonseleniumparallel, :count do |t, args|
require "parallelized_specs"
require File.expand_path(File.dirname(__FILE__) + '/parallel_exclude')
Rake::Task['parallel:spec'].invoke(1, '', '', ParallelExclude::AVAILABLE_FILES)
#executing files in parallel
count = args[:count]
single_thread_files = ParallelExclude::AVAILABLE_FILES
single_thread_files = ParallelExclude::FILES
test_files = FileList['vendor/plugins/*/spec_canvas/**/*_spec.rb'].exclude('vendor/plugins/*/spec_canvas/selenium/*_spec.rb') + FileList['spec/**/*_spec.rb'].exclude('spec/selenium/**/*_spec.rb')
single_thread_files.each { |filename| test_files.delete(filename) } #need to exclude these tests from running in parallel because they have dependencies that break the spces when run in parallel
test_files.map! { |f| "#{Rails.root}/#{f}" }
Rake::Task['parallel:spec'].invoke(count, '', '', test_files.join(' '))
end
task :nonselenium, :count do |t, args|
Rake::Task['spec:single'].invoke #first rake task to run the files that fail in parallel in a single thread
Rake::Task['parallel:nonseleniumparallel'].invoke(args[:count])
end
task :selenium, :count do |t, args|
require "parallelized_specs"
count = args[:count]

View File

@ -78,6 +78,12 @@ unless ARGV.any? { |a| a =~ /\Agems/ }
Rake::Task["spec"].execute
end
desc "Run non-selenium files in a single thread"
Spec::Rake::SpecTask.new(:single) do |t|
require File.expand_path(File.dirname(__FILE__) + '/parallel_exclude')
t.spec_files = ParallelExclude::AVAILABLE_FILES
end
desc "Run all specs in spec directory with RCov (excluding plugin specs)"
Spec::Rake::SpecTask.new(:rcov) do |t|
t.spec_opts = ['--options', "\"#{Rails.root}/spec/spec.opts\""]