spec_helper: improve parallel test handling.
- Clarify the comment of why we have SimpleCov special logic for parallel tests - use a nicer ParallelTests API for checking which process to output the coverage format on
This commit is contained in:
parent
59d56f84ac
commit
92fee908ba
@ -10,10 +10,11 @@ if ENV["HOMEBREW_TESTS_COVERAGE"]
|
||||
]
|
||||
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
|
||||
|
||||
# Needed for outputting coverage reporting only once for parallel_tests
|
||||
if RUBY_PLATFORM[/darwin/] && ENV["TEST_ENV_NUMBER"]
|
||||
SimpleCov.at_exit do
|
||||
result = SimpleCov.result
|
||||
result.format! if ParallelTests.number_of_running_processes <= 1
|
||||
result.format! if ParallelTests.last_process?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user