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.
This commit is contained in:
parent
92f51abf59
commit
86538c9d6a
@ -13,9 +13,17 @@ SimpleCov.start do
|
|||||||
add_filter "Homebrew/vendor/"
|
add_filter "Homebrew/vendor/"
|
||||||
add_filter "Taps/"
|
add_filter "Taps/"
|
||||||
|
|
||||||
# Not using this during integration tests makes the tests 4x times faster
|
if ENV["HOMEBREW_INTEGRATION_TEST"]
|
||||||
# without changing the coverage.
|
command_name ENV["HOMEBREW_INTEGRATION_TEST"]
|
||||||
unless 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"
|
track_files "#{SimpleCov.root}/**/*.rb"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,16 +41,6 @@ SimpleCov.start do
|
|||||||
]
|
]
|
||||||
end
|
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
|
# 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.
|
# 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"]
|
if RUBY_VERSION.split(".").first.to_i >= 2 && !ENV["HOMEBREW_INTEGRATION_TEST"] && ENV["CI"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user