145 Commits

Author SHA1 Message Date
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
Mike McQuaid
844fa3bbd5
spec_helper: increase needs_network timeout and retry.
This should help with flakiness on these tests.
2020-11-17 12:01:09 +00:00
Mike McQuaid
6b27dcb11c
workflows/tests: use Big Sur.
Migrate GitHub Actions to Big Sur.
2020-11-06 15:11:33 +00:00
Mike McQuaid
9d7b0bad11
spec_helper: fix Timeout::Error/SystemExit handling.
These need to be manually caught and set otherwise they will not be
retried by `rspec-retry`. This is particularly annoying and a cause of
CI failures when tests timeout but are not retried.

Fixes https://github.com/Homebrew/brew/issues/8979
2020-10-29 11:05:12 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
5a20968c19 Tweak tests annotations
- Don't skip Git installation tests on generic OS; remove it instead.
- Install Subversion for macOS Subversion tests.
2020-09-11 11:11:42 +01:00
Markus Reiter
196d7badfa Improve RSpec annotations. 2020-09-09 10:24:20 +02:00
Markus Reiter
4d8dcb1d81 Add RSpec formatter for Github Actions. 2020-09-07 23:50:44 +02:00
Markus Reiter
36a8a823a1 Use curl workarounds for both curl and curl_output. 2020-09-05 10:42:35 +02:00
Mike McQuaid
2bdf0d6068
spec_helper: increase tests timeout.
When GitHub Actions is congested some tests can take longer than this
(particularly as we're running in parallel). Globally double the time
we allow for all tests.
2020-08-25 10:20:17 +01:00
Markus Reiter
21c502e05f Remove unused metadata from bundle spec. 2020-08-24 08:31:07 +02:00
William Ma
c8016f6c0a named args: add method tests 2020-08-14 14:10:55 -04:00
Markus Reiter
4bc174cc62 Add timeout for all specs. 2020-07-22 01:09:14 +02:00
Mike McQuaid
2c133a3d45
Check installed dependents on install and reinstall
It's not sufficient to do this merely on `brew upgrade` because
`brew install` and `brew reinstall` can also result in formulae being
upgraded.

This requires moving logic from `cmd/upgrade.rb` to `upgrade.rb`. To
save you searching the diff the changes that resulted from doing that:

- Query the installed formulae from class state in `FormulaInstaller`
  rather than the (incomplete) list that we passed into it.
- Don't output the "Checking dependents" message. It was there for
  systems and configurations where this is slow but for most users
  and most installations this will be a (annoying, noisy) no-op.

Fixes https://github.com/Homebrew/brew/issues/7860
2020-07-02 12:53:52 +01:00