Skip to content

tests: speed up integration tests coverage - #1084

Merged
MikeMcQuaid merged 1 commit into
Homebrew:masterfrom
alyssais:fast_integration_tests
Sep 23, 2016
Merged

MikeMcQuaid merged 1 commit into
Homebrew:masterfrom
alyssais:fast_integration_tests

Conversation

@alyssais

@alyssais alyssais commented Sep 22, 2016 •

Copy link
Copy Markdown
Contributor
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?

This is the speed-up I was referring to in #1041.

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 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.

@alyssais

Copy link
Copy Markdown
Contributor Author

Looks like CI is about 5 minutes faster with this change. 😃

@reitermarkus reitermarkus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Comment thread Library/Homebrew/test/.simplecov Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a speed difference here between SimpleCov::Result.new(Coverage.result) and SimpleCov::Result.new(SimpleCov.add_not_loaded_files(Coverage.result)).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alyssais alyssais mentioned this pull request Sep 22, 2016
4 of 5 tasks
@MikeMcQuaid

Copy link
Copy Markdown
Member

Massive speedup, great work. Is it work updating both the Homebrew and Cask tests Gemfile.lock to pull in the master branch and your commit in simplecov-ruby/simplecov#520 to further speed things up?

@alyssais

Copy link
Copy Markdown
Contributor Author

@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.

@MikeMcQuaid

Copy link
Copy Markdown
Member

@penman Cool. Happy to wait on that one. One conflict to resolve here then happy to 🚢.

@alyssais

Copy link
Copy Markdown
Contributor Author

@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.
@alyssais
alyssais force-pushed the fast_integration_tests branch from e91b447 to 5f6a8d4 Compare September 23, 2016 09:41
@MikeMcQuaid
MikeMcQuaid merged commit 8989275 into Homebrew:master Sep 23, 2016
@MikeMcQuaid

Copy link
Copy Markdown
Member

👏 for dramatic speedup!

@alyssais
alyssais deleted the fast_integration_tests branch September 23, 2016 11:57
alyssais added a commit to alyssais/brew that referenced this pull request Nov 14, 2016
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.
@Homebrew Homebrew locked and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants