Repository navigation
tests: speed up integration tests coverage - #1084
Conversation
|
Looks like CI is about 5 minutes faster with this change. 😃 |
There was a problem hiding this comment.
Is there a speed difference here between SimpleCov::Result.new(Coverage.result) and SimpleCov::Result.new(SimpleCov.add_not_loaded_files(Coverage.result)).
There was a problem hiding this comment.
I don't think so. SimpleCov.add_not_loaded_files(x) just returns x, so I split it out of one long method chain for readability.
|
Massive speedup, great work. Is it work updating both the Homebrew and Cask tests |
|
@MikeMcQuaid I tried it out, but now that we're not accidentally loading in 10000 files it only ended up making a 1 second difference. It looks like #1089 does this anyway. |
|
@penman Cool. Happy to wait on that one. One conflict to resolve here then happy to 🚢. |
|
@MikeMcQuaid great! I'll have that done in a few hours when I'm back at a computer. :) |
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.
e91b447 to
5f6a8d4
Compare
|
👏 for dramatic speedup! |
Suggested in Homebrew#1084. Made the existing warning output entirely to STDERR, because previously the first line went to STDERR and subsequent ones went to STDOUT.
brew testswith your changes locally?This is the speed-up I was referring to in #1041.
Previously, .simplecov called
SimpleCov.resultto 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 pull request 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.