Merge pull request #14674 from issyl0/shorter-code-coverage-output

simplecov: Set `command_name` shorter than "all of the file paths ever"
This commit is contained in:
Mike McQuaid 2023-02-17 14:33:00 +00:00 committed by GitHub
commit a59f5eb524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ SimpleCov.enable_for_subprocesses true
SimpleCov.start do
coverage_dir File.expand_path("../test/coverage", File.realpath(__FILE__))
root File.expand_path("..", File.realpath(__FILE__))
command_name "brew"
# enables branch coverage as well as, the default, line coverage
enable_coverage :branch
@ -17,10 +18,7 @@ SimpleCov.start do
# tests to be dropped. This causes random fluctuations in test coverage.
merge_timeout 86400
at_fork do |pid|
# This needs a unique name so it won't be ovewritten
command_name "#{SimpleCov.command_name} (#{pid})"
at_fork do
# be quiet, the parent process will be in charge of output and checking coverage totals
SimpleCov.print_error_status = false
end
@ -31,8 +29,8 @@ SimpleCov.start do
files = "#{SimpleCov.root}/{#{subdirs},*.rb}"
if ENV["HOMEBREW_INTEGRATION_TEST"]
# This needs a unique name so it won't be ovewritten
command_name "#{ENV["HOMEBREW_INTEGRATION_TEST"]} (#{$PROCESS_ID})"
# This needs a unique name so it won't be overwritten
command_name "i#{ENV.fetch("TEST_ENV_NUMBER", $PROCESS_ID)}"
# be quiet, the parent process will be in charge of output and checking coverage totals
SimpleCov.print_error_status = false
@ -53,7 +51,7 @@ SimpleCov.start do
raise if $ERROR_INFO.is_a?(SystemExit)
end
else
command_name "#{command_name} (#{$PROCESS_ID})"
command_name "b#{ENV.fetch("TEST_ENV_NUMBER", $PROCESS_ID)}"
# Not using this during integration tests makes the tests 4x times faster
# without changing the coverage.