Skip to content

Commit

Permalink
using custom parallelized specs gem for rspec tests
Browse files Browse the repository at this point in the history
Change-Id: Ia7d9ca7fd19267e9a3a66611b50d64bfc7bf3445
Reviewed-on: https://gerrit.instructure.com/10115
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
  • Loading branch information
Jake Sorce committed Apr 23, 2012
1 parent e54d9db commit 90318ab
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 185 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -72,7 +72,7 @@ group :test do
gem 'coffee-script-source', '1.1.2' #pinned so everyone's compiled output matches
gem 'bluecloth', '2.0.10' # for generating api docs
gem 'parallel', '0.5.16'
gem 'parallel_tests-instructure', '0.6.19'
gem 'parallelized_specs', '0.0.8'
gem 'mocha', '0.10.0'
gem 'rcov', '0.9.9'
gem 'rspec', '1.3.2'
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -9,4 +9,4 @@ require 'rdoc/task'

require 'tasks/rails'

begin; require 'parallel_tests/tasks'; rescue LoadError; end
begin; require 'parallelized_specs/tasks'; rescue LoadError; end
33 changes: 33 additions & 0 deletions lib/tasks/parallelized.rake
@@ -0,0 +1,33 @@
# Don't load rspec if running "rake gems:*"
unless ARGV.any? { |a| a =~ /\Agems/ }

namespace :parallel do
task :nonselenium, :count do |t, args|
require "parallelized_specs"
count = args[:count]
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')
test_files.map! { |f| "#{Rails.root}/#{f}" }
Rake::Task['parallel:spec'].invoke(count, '', '', test_files.join(' '))
end

task :selenium, :count do |t, args|
require "parallelized_specs"
count = args[:count]
test_files = FileList['spec/selenium/*_spec.rb'] + FileList['vendor/plugins/*/spec_canvas/selenium/*_spec.rb']
test_files.map! { |f| "#{Rails.root}/#{f}" }
Rake::Task['parallel:spec'].invoke(count, '', '', test_files.join(' '))
end

task :pattern, :count, :file_pattern do |t, args|
require "parallelized_specs"
count = args[:count]
file_pattern = args[:file_pattern]
if count.nil? || file_pattern.nil?
raise "Must specify a thread count and file pattern"
end
test_files = FileList[file_pattern]
test_files.map! { |f| "#{Rails.root}/#{f}" }
Rake::Task['parallel:spec'].invoke(count, '', '', test_files.join(' '))
end
end
end

0 comments on commit 90318ab

Please sign in to comment.