Speed up tests#22852
Open
MikeMcQuaid wants to merge 1 commit into
Open
Conversation
- What: trims setup-heavy profiled test outliers. - What: keeps command integrations to happy paths. - Why: coverage profiling was spending time in setup. - Why: a fast suite makes repeated profile runs practical. - How: create fixture state directly for non-core setup. - How: avoid cask archive extraction in artifact link specs. - How: keep `brew test` fixture executable with a tiny script. - How: shorten fixed sleeps and avoid redundant subprocesses. - When: apply this to profiled examples where setup dominates. - Pros: preserves important command smoke coverage with less wall time. - Pros: removes several multi-second coverage outliers. - Cons: some setup details are no longer end-to-end here. - Tradeoff: negative paths rely more on focused in-process coverage. - Tradeoff: `cmd/upgrade` stays broad because formula+cask is core. - Tradeoff: `cmd/migrate` is unchanged because it failed locally first.
2aa3bca to
0e2ed2e
Compare
Member
Author
|
Seems to speed macOS tests up from ~17m -> ~13m. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
Library/Homebrew/test/cmd/tab_spec.rb:28
- The formula-path coverage for
brew tab --no-installed-on-requestwas removed, so this spec no longer exercises the “unmark” behavior for formulae (only for casks). That leaves the--no-installed-on-requestformula path untested in integration specs.
it "marks a formula as installed on request", :integration_test do
setup_test_formula "foo",
tab_attributes: { "installed_on_request" => false }
foo = Formula["foo"]
expect { brew "tab", "--installed-on-request", "foo" }
Comment on lines
+263
to
+271
| external_patch = formula do | ||
| patch :p1 do | ||
| url "file://#{tarball_fixture("testball-0.1-patches.tgz")}" | ||
| sha256 tarball_fixture_sha256("testball-0.1-patches.tgz") | ||
| apply "noop-a.diff" | ||
| end | ||
| end.stable.patches.last | ||
|
|
||
| expect(external_patch).to have_attributes(strip: :p1, patch_files: ["noop-a.diff"]) |
Comment on lines
+19
to
+20
| formula_prefix = HOMEBREW_CELLAR/"testball/0.1" | ||
| (formula_prefix/"bin").mkpath |
Comment on lines
+11
to
+13
| setup_test_formula "testball", tab_attributes: { installed_on_request: true } | ||
| formula_prefix = HOMEBREW_CELLAR/"testball/0.1" | ||
| (formula_prefix/"bin").mkpath |
Comment on lines
76
to
80
| it "downloads Formula and Cask URLs concurrently", :cask, :integration_test do | ||
| setup_test_formula "testball1" | ||
| setup_test_formula "testball2" | ||
|
|
||
| expect { brew "fetch", "testball1", "testball2", "local-caffeine" }.to be_a_success | ||
| expect { brew "fetch", "testball1", "local-caffeine" }.to be_a_success | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dev-cmd/test_spec.rb.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review, testing and tweaking.