130 Commits

Author SHA1 Message Date
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
Mike McQuaid
170b38892a
Use CodeCov for coverage reporting. 2020-07-02 10:22:54 +01:00
Mike McQuaid
3fc76171ca
spec_helper: retry failing CI tests.
This should help avoid a bit of the flakiness we see in builds at the
cost of a slight slowdown on retries.
2020-06-29 09:54:06 +01:00
Mike McQuaid
c250227750
test/spec_helper: fix needs_svn.
Use the shim to find a valid Subversion.
2020-06-24 10:37:36 +01:00
Mike McQuaid
ef95b59ed4
Remove HomebrewArgvExtension
Fixes #5730
2020-05-23 19:39:11 +01:00
vidusheeamoli
4f1e9f44a1 set up byebug debugger 2020-05-18 16:28:43 +05:30
Mike McQuaid
56c02485e0
rubocops: test whitelists. 2020-04-12 14:17:05 +01:00
Markus Reiter
a6be0e62af Improve spec helper. 2020-04-10 19:39:43 +02:00
Mike McQuaid
04835db85e
Move some brew-test-bot logic to GitHub Actions.
This will improve the output and ease of parsing while allowing code to
be removed from brew-test-bot which relates only to a single repo (this
one).
2019-11-21 19:50:23 +00:00
Mike McQuaid
eb0be5f6fe
test: re-enable portable Ruby tests.
Let's try to get these working again.
2019-11-06 15:36:28 +00:00
Mike McQuaid
6a33959888
test/subversion: fix subversion paths/detection. 2019-11-06 14:58:33 +00:00
Mike McQuaid
22795d7e30
spec_helper: do cache clearing in single location. 2019-11-06 10:20:57 +00:00
Mike McQuaid
ddcbdbe0c0
formula: cache runtime_dependencies related stuff. 2019-11-06 10:04:13 +00:00
Mike McQuaid
eeb9ac36a2
keg: cache runtime_dependencies. 2019-11-06 10:04:13 +00:00
Steven Peters
1ad0addbc8 spec_helper: always remove Frameworks 2019-10-21 12:27:39 -07:00
Steven Peters
875bfbc8d3 spec_helper: workaround for removing Frameworks 2019-10-20 22:47:46 -07:00