Skip to content
Snippets Groups Projects
Commit 86538c9d authored by Martin Afanasjew's avatar Martin Afanasjew Committed by GitHub
Browse files

tests: simplify SimpleCov configuration (#348)

There is no good reason to configure the options specific to integration
tests in a completely different location from all other options.
parent 92f51abf
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,17 @@ SimpleCov.start do
add_filter "Homebrew/vendor/"
add_filter "Taps/"
# Not using this during integration tests makes the tests 4x times faster
# without changing the coverage.
unless ENV["HOMEBREW_INTEGRATION_TEST"]
if ENV["HOMEBREW_INTEGRATION_TEST"]
command_name ENV["HOMEBREW_INTEGRATION_TEST"]
at_exit do
exit_code = $!.nil? ? 0 : $!.status
$stdout.reopen("/dev/null")
SimpleCov.result # Just save result, but don't write formatted output.
exit! exit_code
end
else
# Not using this during integration tests makes the tests 4x times faster
# without changing the coverage.
track_files "#{SimpleCov.root}/**/*.rb"
end
......@@ -33,16 +41,6 @@ SimpleCov.start do
]
end
if ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.command_name ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.at_exit do
exit_code = $!.nil? ? 0 : $!.status
$stdout.reopen("/dev/null")
SimpleCov.result # Just save result, but don't write formatted output.
exit! exit_code
end
end
# Don't use Coveralls outside of CI, as it will override SimpleCov's default
# formatter causing the `index.html` not to be written once all tests finish.
if RUBY_VERSION.split(".").first.to_i >= 2 && !ENV["HOMEBREW_INTEGRATION_TEST"] && ENV["CI"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment