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
if ENV["PARALLEL_SPEC"] == '1' &&
!specs.split.any? { |s| puts s; s =~ /\:/ } # Parallel spec can't run specific groups
line_specified = specs.split.any? { |s| s =~ /\:/ } # Parallel spec can't run specific line
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(" ")}"
else
"bin/rspec #{args.join(" ")} #{specs.split.join(" ")}"