Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .rubocop_gradual.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"lib/turbo_tests/reporter.rb:1386902608": [
[7, 5, 400, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2092085575]
],
"lib/turbo_tests/runner.rb:1092969829": [
"lib/turbo_tests/runner.rb:3421474245": [
[13, 5, 271, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 21989008],
[20, 5, 1311, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1925027850],
[216, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[234, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
[236, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[245, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[305, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
[221, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[239, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
[241, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[250, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[310, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
],
"spec/cli_spec.rb:3990998076": [
[1, 1, 30, "RSpec/SpecFilePathFormat: Spec path should end with `turbo_tests/cli*_spec.rb`.", 965721356],
Expand Down
9 changes: 7 additions & 2 deletions lib/turbo_tests/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def run
ParallelTests::RSpec::Runner.tests_with_size(@files, {}).size,
].min

options_file = [".rspec_parallel", "spec/parallel_spec.opts", "spec/spec.opts"].detect { |f| File.file?(f) }

tests_in_groups =
ParallelTests::RSpec::Runner.tests_in_groups(
@files,
Expand All @@ -108,6 +110,7 @@ def run

subprocess_opts = {
record_runtime: @record_runtime,
options_file: options_file,
}

@reporter.report(tests_in_groups) do |_reporter|
Expand Down Expand Up @@ -151,7 +154,7 @@ def start_regular_subprocess(tests, process_id, **opts)
)
end

def start_subprocess(env, extra_args, tests, process_id, record_runtime:)
def start_subprocess(env, extra_args, tests, process_id, record_runtime:, options_file:)
if tests.empty?
@messages << {
type: "exit",
Expand Down Expand Up @@ -188,16 +191,18 @@ def start_subprocess(env, extra_args, tests, process_id, record_runtime:)
[]
end

spec_opts = ["-O", options_file] if options_file

command = [
*command_name,
*extra_args,
*seed_option,
"--format",
"TurboTests::JsonRowsFormatter",
*record_runtime_options,
*spec_opts,
*tests,
]
command.unshift(ENV["BUNDLE_BIN_PATH"], "exec") if ENV["BUNDLE_BIN_PATH"]
command.unshift("nice") if @nice

if @verbose
Expand Down