DEV: Use runtime info to split test files for parallel testing (#22060)

Using the runtime information, we will be able to more efficiently group
the test files across the test processes hence leading to better
utilization of resources.
This commit is contained in:
Alan Guo Xiang Tan
2023-06-12 10:07:17 +09:00
committed by GitHub
parent b4611114f9
commit 5897709a90
2 changed files with 14 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ fail_fast = nil
seed = rand(2**16)
profile = false
profile_print_slowest_examples_count = 10
use_runtime_info = nil
OptionParser
.new do |opts|
@@ -49,6 +50,10 @@ OptionParser
end
opts.on("--seed SEED", "The seed for the random order") { |s| seed = s.to_i }
opts.on("--use-runtime-info", "Use runtime info for tests group splitting") do
use_runtime_info = true
end
end
.parse!(ARGV)
@@ -60,10 +65,10 @@ formatters.each { |formatter| formatter[:outputs] << "-" if formatter[:outputs].
if ARGV.empty?
files = TurboTests::Runner.default_spec_folders
use_runtime_info = true
use_runtime_info = true if use_runtime_info.nil?
else
files = ARGV
use_runtime_info = false
use_runtime_info = false if use_runtime_info.nil?
end
puts "::group::Run turbo_rspec" if ENV["GITHUB_ACTIONS"]