DEV: Skip parallel autospec spec for a single file (#11206)

turbo_rspec can't parallelize a single spec file, so it's not worth the extra setup time for the parallel runner
This commit is contained in:
David Taylor 2020-11-11 19:13:32 +00:00 committed by GitHub
parent ae8c96ed35
commit 24976669b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,9 +22,9 @@ module Autospec
] ]
command = begin command = begin
if ENV["PARALLEL_SPEC"] == '1' && line_specified = specs.split.any? { |s| s =~ /\:/ } # Parallel spec can't run specific line
!specs.split.any? { |s| puts s; s =~ /\:/ } # Parallel spec can't run specific groups multiple_files = specs.split.count > 1 # Only paralellize multiple files
if ENV["PARALLEL_SPEC"] == '1' && multiple_files && !line_specified
"bin/turbo_rspec #{args.join(" ")} #{specs.split.join(" ")}" "bin/turbo_rspec #{args.join(" ")} #{specs.split.join(" ")}"
else else
"bin/rspec #{args.join(" ")} #{specs.split.join(" ")}" "bin/rspec #{args.join(" ")} #{specs.split.join(" ")}"