forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using custom parallelized specs gem for rspec tests
Change-Id: Ia7d9ca7fd19267e9a3a66611b50d64bfc7bf3445 Reviewed-on: https://gerrit.instructure.com/10115 Tested-by: Hudson <[email protected]> Reviewed-by: Bryan Madsen <[email protected]>
- Loading branch information
Jake Sorce
committed
Apr 23, 2012
1 parent
e54d9db
commit 90318ab
Showing
5 changed files
with
185 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.