Test without Sorbet runtime#23099
Merged
Merged
Conversation
8 tasks
e23dfa5 to
d773f93
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to add regression coverage for running brew tests with Sorbet runtime checking disabled, adjusting a few runtime guards and updating specs/CI to avoid relying on Sorbet runtime error behavior.
Changes:
- Add a CI matrix entry to run
brew testsin a “no Sorbet” configuration and add a corresponding unit test. - Replace Sorbet-runtime-dependent behaviors (e.g.,
abstractraising) with explicit runtime exceptions (e.g.,NotImplementedError) and add a manual safeguard forFormula#brewoverrides. - Update or remove specs that asserted Sorbet runtime TypeErrors/messages.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/version/parser.rb | Replace abstract process_spec behavior with explicit NotImplementedError. |
| Library/Homebrew/test/version/parser_spec.rb | Update expectation to match the new NotImplementedError. |
| Library/Homebrew/test/version_spec.rb | Remove Sorbet-runtime-dependent TypeError assertions for invalid Version.new inputs. |
| Library/Homebrew/test/utils/curl_spec.rb | Remove Sorbet-runtime-dependent TypeError assertions for invalid numeric args. |
| Library/Homebrew/test/resource_spec.rb | Remove Sorbet-runtime-dependent TypeError assertions for non-string resource versions. |
| Library/Homebrew/test/pkg_version_spec.rb | Remove Sorbet-runtime-dependent TypeError assertions for comparisons to non-PkgVersion. |
| Library/Homebrew/test/livecheck/strategy/git_spec.rb | Update description/comments to reflect non-string filtering behavior. |
| Library/Homebrew/test/livecheck/livecheck_spec.rb | Replace Sorbet reflection-based expectation with a hardcoded parameter list. |
| Library/Homebrew/test/livecheck_spec.rb | Remove Sorbet-runtime-dependent TypeError assertion for non-string formula argument. |
| Library/Homebrew/test/formula_validation_spec.rb | Relax error message assertion for overriding brew. |
| Library/Homebrew/test/formula_spec.rb | Update stubs to match Formulary.load_formula_from_path keyword arguments. |
| Library/Homebrew/test/dev-cmd/tests_spec.rb | Add a spec for disabling Sorbet runtime and call setup_environment! directly. |
| Library/Homebrew/test/dependency_spec.rb | Remove Sorbet-runtime-dependent TypeError assertion for nil dependency name. |
| Library/Homebrew/test/dependency_collector_spec.rb | Remove Sorbet-runtime-dependent TypeError assertion for unknown types. |
| Library/Homebrew/test/bundle/dsl_spec.rb | Remove “bad options” assertions for brew and tap entries. |
| Library/Homebrew/livecheck/strategy/git.rb | Skip non-string matches instead of rescuing TypeError on Version.new. |
| Library/Homebrew/formula.rb | Add a runtime guard preventing brew being overridden by subclasses. |
| Library/Homebrew/dev-cmd/tests.rb | Add env-controlled toggling to delete/enable Sorbet runtime env vars during test setup. |
| .github/workflows/tests.yml | Add “tests (no Sorbet)” job and set HOMEBREW_TESTS_NO_SORBET_RUNTIME=1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d773f93 to
6578002
Compare
carlocab
approved these changes
Jul 14, 2026
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.
This will provide some regression testing for the path that users hit.
CC @dduugg this should hopefully help avoid 💥 in future.
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review and testing.