158 Commits

Author SHA1 Message Date
Issy Long
bc5e422815
Merge pull request #16497 from issyl0/rubocop-new-rules-style-array-intersect
Fix RuboCop `Style/ArrayIntersect` offenses
2024-01-19 13:00:30 +00:00
Bo Anderson
ec0434c549
Tweak library load path insertion to be as early as possible 2024-01-18 14:54:14 +00:00
Issy Long
0e27dc2564
Fix RuboCop Style/ArrayIntersect offenses 2024-01-18 14:11:43 +00:00
Markus Reiter
4b7aed84fa
Add test for print_stdout: :debug. 2023-10-10 03:42:22 +02:00
Bo Anderson
e4623cc8f4
Improve performance of brew readall 2023-09-28 14:05:09 +01:00
Mike McQuaid
b7114651ac
utils/curl: include or use explicitly.
Include or use `Utils::Curl` explicitly everywhere it is used.
2023-09-04 22:17:57 -04:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Douglas Eichelberger
cc5b013cb9 Remove compatibility layer 2023-03-14 14:49:34 -07:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +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
Douglas Eichelberger
f126f0d39b Refactor away rspec/wait 2023-01-25 10:07:42 -08:00
apainintheneck
b7e28ef48f Make :formula? the default on Linux
This makes :formula? the default whenever
defined throughout the codebase on Linux.
It also makes :cask? illegal for all Linux
users.
2022-12-04 19:43:12 -08:00
Mike McQuaid
416af82670
macOS Ventura (and related) test fixes
- fix `check_for_config_scripts` test, no idea why this wasn't working
- don't autoretry tests if `focus` or `byebug` are enabled
- add a ARM64 Ventura bottle symlink
2022-10-20 11:28:27 +01:00
apainintheneck
a178fc6a88 Cleanup no cask on linux specs 2022-10-02 08:51:17 -07:00
apainintheneck
5d27b70757 Set --formula by default on linux 2022-10-01 17:28:07 -07:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01:00
Bo Anderson
cd73e6bac5
Introduce more Ruby constants for values set by brew.sh 2022-06-17 19:47:57 +01:00
Bo Anderson
50437ca07e
Clear cached curl path where HOMEBREW_CURL changes 2022-06-17 19:47:55 +01:00
Bo Anderson
b63595a627
test/cask/quarantine: improve audit test output 2022-05-31 03:29:42 +01:00
Bo Anderson
4db0b9963c
test/spec_helper: prevent stdin trashing 2022-03-06 19:06:28 +00:00
Mike McQuaid
b09f421027
repology: always use Homebrew curl.
This seems to be required even with TLSv1.3 support now.

Also, while we're here, improve the error handling/output.
2022-01-03 13:17:12 +00:00
fn ⌃ ⌥
aa6f10ff35 install, upgrade: fetch each formula only once 2021-10-31 10:52:40 -07:00
EricFromCanada
c952ea7358
bump: fix tests 2021-10-25 15:55:11 -04:00
EricFromCanada
811d0fa0bd
bump: add option to retrieve a subset of results
Plus a few fixes for output.
2021-10-19 20:14:39 -04:00
Bo Anderson
30b24cf4ad
Use HOMEBREW_CURL universally, including formulae 2021-10-04 02:03:04 +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
Mike McQuaid
bd4c37bfda
Merge pull request #10514 from thomasrockhu/codecov-action
Add Codecov GitHub Action step
2021-04-02 20:02:51 +01:00
Tom Hu
ff7a0a121f
typo 2021-04-01 21:19:56 -04:00
Tom Hu
bba27eefec
Use double quotes 2021-04-01 20:29:27 -04:00
Tom Hu
0947ab6c29
Use simplecov-cobertura 2021-04-01 18:59:46 -04:00
Tom Hu
ff7c05a285
Merge branch 'master' into codecov-action 2021-03-21 14:58:03 -04:00
Bo Anderson
e49a338896
Implement caching for dependency expansion 2021-03-20 16:56:00 +00:00
Rylan Polster
79e93f54e2
Ignore more parser warnings 2021-02-14 11:58:05 -05:00
Tom Hu
7d8437608e Add JSONFormatter explicitly 2021-02-04 12:35:55 -05:00
Tom Hu
1fb58d5b2f Add Codecov GitHub Action step 2021-02-03 22:46:05 -05:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +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
Mike McQuaid
f38707e92a
spec_helper: fix and improve retry logic.
- always retry each test at least once (confusingly this means a retry
  count of 2 rather than 1)
- always wait at least 1 second between retries
- set a default retry metadata for integration tests rather than
  overriding any specified values
- use `example.run` rather than `example.run_with_retry` for integration
  tests because, confusingly, this avoids having the retry count be
  half what it should be (because the attempts increases by one for
  each `run_with_retry` call)
- use 4 retries for integration tests with 2**attempts*retry_wait
  (retry wait now being 2) to actually have more retries than before
  this commit (but with exponential backoff)

This should generally improve test flakiness in CI but particularly
improve the cleanup test flake we've seen recently.
2021-01-27 12:43:30 +00:00
Issy Long
3c2467fc3d
Replace test/support/github_formatter with rspec-github gem
- This was a TODO in `test/support/github_formatter.rb` and the PR it
  referenced had been merged.
2020-12-22 18:03:01 +00:00
Markus Reiter
2dd40720f0 Add test for SystemCommand with SIGINT handler. 2020-12-18 16:48:49 +01:00
Rylan Polster
f450bfbf5e style: migrate some lists back to Homebrew/brew 2020-12-02 20:56:07 -05:00
Rylan Polster
f8ff0f465f tap: add tests for formula list methods 2020-11-30 18:18:50 -05:00
Rylan Polster
ba63619f8e tests: remove final reference to formula_exist 2020-11-30 18:18:50 -05:00
Markus Reiter
8298f95677 Increase timeout for integration tests. 2020-11-30 20:52:27 +01:00
Markus Reiter
ca333a5da0
Merge pull request #9199 from reitermarkus/type-signatures
Add more type signatures and `rspec-sorbet`.
2020-11-19 18:11:51 +01:00
Markus Reiter
ae8ebf9464 Add rspec-sorbet. 2020-11-19 16:14:22 +01:00
Mike McQuaid
35db40fe25
Disable Java requirement versions on Big Sur
It would be possible to work around this but I'm not convinced it's
worth it given https://github.com/Homebrew/homebrew-core/issues/63290

Fixes #9194
2020-11-19 14:03:57 +00:00