Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Dec 4, 2025

  • 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 lgtm (style, typechecking and tests) with your changes locally?

Bottle pour is faster to test than source-build as it avoids setting up build environment and starting another Ruby process.

Example result for reinstall:

  • source: 8.56 seconds ./test/cmd/reinstall_spec.rb:10
  • bottle: 4.65 seconds ./test/cmd/reinstall_spec.rb:10

cmd/install_spec only partly benefits as it still needs to run source build tests for options, HEAD, etc.

Copilot AI review requested due to automatic review settings December 4, 2025 23:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes integration test performance by switching from source builds to bottle pours for faster test execution. The change reduces test execution time significantly (e.g., reinstall tests from ~8.5s to ~4.6s) by avoiding build environment setup and additional Ruby process overhead.

Key Changes

  • Added automatic bottle block generation for testball_bottle formula in integration test helper
  • Converted upgrade, reinstall, and install tests to use testball_bottle instead of source-built formulas
  • Added HOMEBREW_TEMP_CELLAR to test cleanup directories to handle bottle extraction artifacts

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb Added automatic bottle block generation for testball_bottle formula with SHA256 hash and root URL pointing to test fixtures
Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.all.bottle.tar.gz Added bottle fixture file for cross-platform testing
Library/Homebrew/test/spec_helper.rb Added HOMEBREW_TEMP_CELLAR to TEST_DIRECTORIES for proper cleanup
Library/Homebrew/test/cmd/upgrade_spec.rb Refactored to use testball_bottle instead of testball, updated all references to use consistent formula_name variable
Library/Homebrew/test/cmd/reinstall_spec.rb Refactored to use testball_bottle, added explicit link call after setup, updated path references
Library/Homebrew/test/cmd/install_spec.rb Split into two separate tests: one for bottle installation and one for source installation, with appropriate expectations for each

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cho-m cho-m marked this pull request as draft December 4, 2025 23:34
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@cho-m cho-m force-pushed the test-reinstall-with-bottle branch from 3386050 to 59036c1 Compare December 11, 2025 21:33
@cho-m cho-m marked this pull request as ready for review December 11, 2025 21:33
@cho-m cho-m requested a review from Copilot December 11, 2025 21:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Great work again, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 12, 2025
Merged via the queue into main with commit 0cc7fc6 Dec 12, 2025
62 of 63 checks passed
@MikeMcQuaid MikeMcQuaid deleted the test-reinstall-with-bottle branch December 12, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants