brew icon indicating copy to clipboard operation
brew copied to clipboard

`brew tests` should pass with `homebrew/core` untapped

Open rrotter opened this issue 1 year ago • 4 comments

Verification

  • [X] This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

Provide a detailed description of the proposed feature

When running brew tests, if homebrew/core isn't tapped we should either automatically tap it (not unprecedented, brew generate-man-completions taps homebrew/command-not-found homebrew/services and homebrew/test-bot) or print a warning that failures are expected (w/ instructions to run brew tap --force homebrew/core).

What is the motivation for the feature?

The PR instructions instruct contributors to run brew tests, if you're working on a PR. This will fail if a user is working on a contribution to homebrew/brew and doesn't have homebrew/core tapped because it's not needed for their present work.

How will the feature be relevant to at least 90% of Homebrew users?

It will help 90% of new contributors to homebrew/core have a smoother experience and be more likely to contribute to this project.

What alternatives to the feature have been considered?

Could also add a note at https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request that brew tap --force homebrew/core is required for running brew tests.

rrotter avatar Apr 25 '24 00:04 rrotter

print a warning that failures are expected (w/ instructions to run brew tap --force homebrew/core).

Do you have an example of some failures that occur?

What alternatives to the feature have been considered?

Another option could be fixing up tests so homebrew/core isn't required to be tapped.

MikeMcQuaid avatar Apr 25 '24 07:04 MikeMcQuaid

Good point. There are 64 failures, every one of them is in rubocops/uses_from_macos or rubocops/provided_by_macos.

rrotter avatar Apr 26 '24 02:04 rrotter

That's useful info - thanks!

This will be because https://github.com/Homebrew/brew/blob/master/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb doesn't support API-only installs yet (but should).

If it turns out tricky to fix then skipping the test under such environments could be a compromise.

Bo98 avatar Apr 26 '24 03:04 Bo98

This will be because master/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb doesn't support API-only installs yet (but should).

Yeh, this feels like the best scope for this issue 👍🏻

MikeMcQuaid avatar Apr 26 '24 07:04 MikeMcQuaid