This reverts commit 252c701c59227c385ef6178fe99523cca8c843bb.
Taps installed prior to running the test suite are not visible to the
test suite as most Homebrew paths are redefined as to not mess up the
local installation.
All of these taps use Homebrew internal APIs (or will shortly) and we
autoinstall them all from `brew $CMD`. We should adjust our CI to ensure
that we never accidentally break these taps when making changes to core
code so that these taps can rely more on this core code rather than
having to e.g. vendor equivalent code that never changes on our end.
Set HOMEBREW_NO_GITHUB_API to allow running all tests (but search's
integration test specifically for now) offline. This can be overridden
with `--online`.
This prevents `brew` self-calls from interacting with the stickiness of
HOMEBREW_NO_ANALYTICS being persisted to the brew repo and accidentally
disabling analytics permanently when it should have been for just one run,
while restoring the stickiness of an explicit user-supplied
HOMEBREW_NO_ANALYTICS.
- add `HOMEBREW_PRODUCT` global variable
- only differentiate between `/usr/local` and `non-/usr/local` Homebrew
prefixes to avoid sharing sensitive user information
- note if e.g. build errors are occurring under CI
- Add `HOMEBREW_NO_ANALYTICS` variable (this will be how people opt-out
when this is enabled for everyone)
- Add `HOMEBREW_ANALYTICS_DEBUG` variable to output all the analytics
that are sent
- Move Bash analytics code to `Library/Homebrew/utils/analytics.sh`
- Add documentation for our analytics and why/what/when/how and opt-out
- Only official Homebrew commands are reported
- Ruby analytics are now reported in a forked, background process
Simplify running a single test (or even a single method from a single
test), which is useful when developing or debugging a test. Instead of
`brew test TEST=test_diagnostic.rb TESTOPTS=--name=test_check_DYLD_vars`
it is now possible to run `brew tests --only=diagnostic/check_DYLD_vars`
to get the same effect. Similarly, `brew tests --only=diagnostic` maps
to `brew test TEST=test_diagnostic.rb`.
ClosesHomebrew/homebrew#48279.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This parameter is printed by every `brew tests` run and feeding it back
into the test suite allows to get an identical run. Make it easier to
do that by accepting the argument as it is printed during `brew tests`.
This requires a slight adjustment to named-argument passing as the
number that follows `--seed` is also seen as a named argument, but we
usually only want to pass `TEST=<something>` and `TESTOPTS=<something>`.
Some tests, that construct a Git repository for testing, will silently
fail if the global Git user isn't properly set up. There are valid use
cases for this, thus use a fixed commit author/committer for all tests
instead of relying on the user's configuration.