Skip to content

Test without Sorbet runtime#23099

Merged
MikeMcQuaid merged 1 commit into
mainfrom
tests-without-sorbet-runtime
Jul 14, 2026
Merged

Test without Sorbet runtime#23099
MikeMcQuaid merged 1 commit into
mainfrom
tests-without-sorbet-runtime

Conversation

@MikeMcQuaid

@MikeMcQuaid MikeMcQuaid commented Jul 14, 2026

Copy link
Copy Markdown
Member

This will provide some regression testing for the path that users hit.

CC @dduugg this should hopefully help avoid 💥 in future.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local review and testing.


@MikeMcQuaid MikeMcQuaid force-pushed the tests-without-sorbet-runtime branch 2 times, most recently from e23dfa5 to d773f93 Compare July 14, 2026 11:19
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review July 14, 2026 11:30
Copilot AI review requested due to automatic review settings July 14, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 tests in a “no Sorbet” configuration and add a corresponding unit test.
  • Replace Sorbet-runtime-dependent behaviors (e.g., abstract raising) with explicit runtime exceptions (e.g., NotImplementedError) and add a manual safeguard for Formula#brew overrides.
  • 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.

Comment thread Library/Homebrew/dev-cmd/tests.rb Outdated
Comment thread Library/Homebrew/test/livecheck/livecheck_spec.rb
Comment thread Library/Homebrew/test/formula_validation_spec.rb
Comment thread Library/Homebrew/test/bundle/dsl_spec.rb
@MikeMcQuaid MikeMcQuaid force-pushed the tests-without-sorbet-runtime branch from d773f93 to 6578002 Compare July 14, 2026 12:17
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 32f23a9 Jul 14, 2026
43 checks passed
@MikeMcQuaid MikeMcQuaid deleted the tests-without-sorbet-runtime branch July 14, 2026 12:57
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