DEV: Support running Ruby tests in parallel (#7087)
This commit is contained in:
parent
bf0c855287
commit
edffd0097f
|
@ -124,6 +124,18 @@ task 'docker:test' do
|
|||
if ENV["RSPEC_SEED"]
|
||||
params << "--seed #{ENV["RSPEC_SEED"]}"
|
||||
end
|
||||
|
||||
if ENV['PARALLEL']
|
||||
parts = ENV['PARALLEL'].split("/")
|
||||
total = parts[1].to_i
|
||||
subset = parts[0].to_i - 1
|
||||
|
||||
spec_partials = Dir["spec/**/*_spec.rb"].sort.in_groups(total, false)
|
||||
params << spec_partials[subset].join(' ')
|
||||
|
||||
puts "Running spec subset #{subset + 1} of #{total}"
|
||||
end
|
||||
|
||||
@good &&= run_or_fail("bundle exec rspec #{params.join(' ')}".strip)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue