133 Commits

Author SHA1 Message Date
Bo Anderson
8bafbcd65a
Split prof gems into their own group 2023-03-31 13:32:38 +01:00
Nanda H Krishna
b8fb963516
dev-cmd/tests: temporary fix for BuildPulse failure 2023-03-31 03:50:05 -04:00
Issy Long
a480982e75
dev-cmd/tests: Deal with TODO for a BuildPulse bug that's fixed
- This does what the comment told us to do, use the bang variant of
  `system_command` to not swallow the errors.
2023-03-29 20:54:42 +01:00
Douglas Eichelberger
cc5b013cb9 Remove compatibility layer 2023-03-14 14:49:34 -07:00
Douglas Eichelberger
0b04b99e68 brew typecheck --suggest-typed --update 2023-03-09 20:32:46 -08:00
Bo Anderson
c32a1b8104
dev-cmd/tests: ignore BuildPulse failures for now 2023-03-01 22:21:45 +00:00
Bo Anderson
f4067ac5fe
dev-cmd/tests: better output for BuildPulse failures 2023-03-01 20:42:50 +00:00
Mike McQuaid
80232af31d
More tweaks to testing output and speed
- Never bother to do `brew cleanup` after `brew install`
- Skip `brew test-bot --only-cleanup-before` in more places it's not
  needed
- Move `brew config`/`brew doctor` into the default formula run
  (through `brew test-bot --only-setup`)
- Install `buildpulse-test-reporter` rather than letting `brew tests`
  do it
- Improve the formatting of the `brew tests` step
- Further shorten the code coverage filenames
- Don't output BuildPulse results upload status unless failed
2023-02-17 16:17:45 +00:00
Mike McQuaid
a743e9277f
workflows/tests: faster, more reliable tests.
- Extract update tests into separate tests.
- Make `brew tests --online` run only once in its own job. This job
  could be made non-required to fight flakiness.
- Split up the various macOS runs into several steps now that we have
  more parallel macOS workers available.
- Cleanup some flaky tests.
2023-02-17 15:26:18 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
2a5d41d41b
Revert "Merge pull request #14547 from Homebrew/revert-14412-homebrew_install_from_api_default"
This reverts commit f4e60482791d2ff628efadfdbf0d14d9237d2d29, reversing
changes made to e26784f424061ca16987afcb21e036c66a298492.
2023-02-07 19:25:40 +01:00
Mike McQuaid
0575903868
Revert "HOMEBREW_INSTALL_FROM_API: make the default for everyone." 2023-02-07 15:13:23 +01:00
Mike McQuaid
5f6c69bca2
HOMEBREW_INSTALL_FROM_API: make the default for everyone.
- remove all places we check the flag so it's a no-op now
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where
  relevant
- adjust the documentation
2023-02-05 18:13:08 +01:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Mike McQuaid
2961132e01
tests: fix under GitHub Codespaces. 2022-11-03 16:33:04 +00:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Bo Anderson
c87c97e4d7
utils/gems: install Bundler into vendor directory 2022-10-14 01:30:34 +01:00
Bo Anderson
e4264c9f35
Replace sorbet-runtime-stub with sorbet-runtime 2022-07-19 23:43:14 +01:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01:00
apainintheneck
489d38324b 'brew tests --changed' supports changed test files 2022-05-03 01:04:22 -07:00
apainintheneck
b7d88225bb Added --changed option to "brew tests" dev cmd
This option allows the user to run tests on all
files that have been changed from the master
branch.
2022-04-19 09:53:45 -07:00
XuehaiPan
9ef52080e3 utils: extract common word "for" in reason 2021-11-23 23:59:09 +08:00
XuehaiPan
d749173adc utils: mark reason as keyword argument in ensure_formula_installed! 2021-11-23 23:31:22 +08:00
XuehaiPan
3376479e95 utils: add method ensure_formula_installed! 2021-11-23 22:48:39 +08:00
Mike McQuaid
41e94afda5
Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Mike McQuaid
d490e2a9a7
Fix BuildPulse handling
- be more verbose with output to be clear when we're using/submitting to
  BuildPulse
- remove the duplicate BuildPulse submission step
2021-06-30 09:20:56 +01:00
Mike McQuaid
a4c2e0e1b3
Tweak BuildPulse/rspec-retry logic
BuildPulse is trying to find flaky tests for us but, given the previous
model of using `rspec-retry`, it would rarely find them. Instead, let's
try to always rerun `brew tests` multiple times, report to BuildPulse
each time (by moving the reporting logic into `brew tests`) and disable
`rspec-retry` when using BuildPulse.

While we're here, let's enable `rspec-retry` locally so we don't have
flaky tests biting maintainers/contributors there.
2021-06-29 12:43:47 +01:00
Jason Rudolph
e163eb8650
Enhance test suite to emit JUnit XML test reports
In preparation for detecting flaky tests with BuildPulse, this commit
sets up the rspec_junit_formatter gem to output JUnit XML reports of the
test suite, which is the format used by BuildPulse and various other
tooling that interprets test results.

Because the test suite uses the parallel_tests gem, this commit
incorporates some related changes to make all the parallel_tests gem and
the rspec_junit_formatter gem to cooperate with each other.

rspec_junit_formatter writes everything to a single XML file. That works
fine when there's only one process writing to the file. By default,
whatever process finishes last will write to the file and clobber the
output of all the other processes that wrote to the file. 🙈

To prevent this issue, the parallel_tests wiki recommends adding a
`.rspec_parallel` file to specify its RSpec options
(https://github.com/grosser/parallel_tests/wiki#with-rspec_junit_formatter----by-jgarber),
then the project can specify different files for each process to write
to like so:

  --format RspecJunitFormatter
  --out tmp/rspec<%= ENV['TEST_ENV_NUMBER'] %>.xml

However, prior to this commit, the Homebrew/brew test suite specified
its RSpec options via the command line. Unfortunately though, there's no
way (AFAICT) to set the equivalent of these options via the command
line:

  --format RspecJunitFormatter
  --out tmp/rspec<%= ENV['TEST_ENV_NUMBER'] %>.xml

So, we need to use a `.rspec_parallel` file to specify these options ☝️.

However, it appears that RSpec allows you to specify formatters _either_
in an options file (like `.rspec_parallel`) _or_ via command-line args.
But if you specify any formatters via command-line args, then all
formatters in the options file are ignored.  (I suspect that's somehow
related to this bit of code in rspec-core:
https://github.com/rspec/rspec-core/blob/v3.10.0/lib/rspec/core/configuration_options.rb#L64.)

With that in mind, in order to have the RspecJunitFormatter configured
 in `.rspec_parallel`, we need to move the other formatters into
 `.rpsec_parallel` as well, instead of passing them as command-line
 args. Therefore, this commit moves all the formatters into a
 `.rspec_parallel` file.
2021-06-21 13:14:18 -04:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
hyuraku
a3063882e6 tests: fix a option bug 2021-04-08 20:23:50 +09:00
hyuraku
3c308aa031 create different tests log with each options 2021-04-06 09:38:37 +09:00
hyuraku
7fbe08e857 add a directory for test log 2021-04-03 19:03:35 +09:00
hyuraku
854b898856 change test log path 2021-04-03 18:45:46 +09:00
hyuraku
7f5a97d1f3 change directory for log 2021-04-03 18:45:46 +09:00
hyuraku
0ebc90ee67 cache paralell tests log on ci 2021-04-03 18:45:46 +09:00
Mike McQuaid
4fe86661ac
tests: cleanup user configuration. 2021-01-28 10:54:26 +00:00
Mike McQuaid
da94957b01
tests: verbose tests with --verbose or --debug.
The `VERBOSE_TESTS` variable was from cask and never gets set (and
is unset by `bin/brew`). Replace it with `HOMEBREW_VERBOSE_TESTS` and
set it by `--verbose` or `--debug`.

While we're here, remove an unneeded `VERBOSE` delete (as it's already
done by `bin/brew`).
2021-01-27 15:04:13 +00:00
Rylan Polster
d1f3e39b7b
Update commands to generate usage banner 2021-01-18 21:20:11 -05:00
Rylan Polster
da811373d3 Add named_args DSL for commands 2021-01-13 17:09:42 -05:00
Markus Reiter
f438fa98be Avoid reinstalling bundler in integration tests. 2020-11-30 20:52:27 +01:00
Mike McQuaid
74264b8582
Big Sur cleanup
Remove `HOMEBREW_BIG_SUR_TESTING` variable as it is no longer needed.
2020-11-18 10:15:53 +00:00
Markus Reiter
7904cfd122
Merge pull request #9183 from reitermarkus/fix-tests
Unset `HOMEBREW_BAT` in tests.
2020-11-18 08:06:58 +01:00
Markus Reiter
dfeb1b4d08 Unset HOMEBREW_BAT in tests. 2020-11-18 07:03:39 +01:00
Markus Reiter
f87c9c5dc4 Fix tests failing locally. 2020-11-18 05:54:42 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
d36df37099 Replace custom stubs with sorbet-runtime-stub. 2020-10-09 16:45:13 +02:00
Markus Reiter
4d8dcb1d81 Add RSpec formatter for Github Actions. 2020-09-07 23:50:44 +02:00