aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Ross2016-09-22 17:40:52 +0100
committerAlyssa Ross2016-09-23 10:40:08 +0100
commit5f6a8d407aa70b8f83e89a6c8bd8d2b5d619eb0a (patch)
tree1f2151dc9fee3656d80741b25664f69c07491f44
parent759ee585d54e3eeb53bf12b74843f0628fc71006 (diff)
downloadbrew-5f6a8d407aa70b8f83e89a6c8bd8d2b5d619eb0a.tar.bz2
tests: speed up integration tests coverage
Previously, .simplecov called `SimpleCov.result` to store the coverage result, and ignored the return value. `SimpleCov.result`'s return can be slow to calculate, which wastes a lot of time when it's ignored. This commit extracts the code needed to store the SimpleCov result from `SimpleCov.result`, and calls it directly, without doing the busywork to compute the return value every time. In my testing, this more than halves the time taken to run all the integration tests.
-rwxr-xr-xLibrary/Homebrew/.simplecov8
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/.simplecov b/Library/Homebrew/.simplecov
index e53f011cd..bc4ed7bb1 100755
--- a/Library/Homebrew/.simplecov
+++ b/Library/Homebrew/.simplecov
@@ -20,7 +20,13 @@ SimpleCov.start do
at_exit do
exit_code = $!.nil? ? 0 : $!.status
$stdout.reopen("/dev/null")
- SimpleCov.result # Just save result, but don't write formatted output.
+
+ # Just save result, but don't write formatted output.
+ coverage_result = Coverage.result
+ SimpleCov.add_not_loaded_files(coverage_result)
+ simplecov_result = SimpleCov::Result.new(coverage_result)
+ SimpleCov::ResultMerger.store_result(simplecov_result)
+
exit! exit_code
end
else