117 Commits

Author SHA1 Message Date
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
Mike McQuaid
1b4fdc17f4
Raise deprecation exceptions in tests
Previously tests which hit `odeprecated` would print warnings but not
always raise exceptions or fail. Combine this with the ability to have
`odeprecated` to turn into `odisabled` on certain dates and you have
tests that may fail just on the clock changing (this is bad).

Instead, ensure that tests always raise deprecations as exceptions so
that new deprecations will have their tests handled immediately.
2019-10-15 08:52:42 +01:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Mike McQuaid
2d51b8189b
test: disable some tests on Linux portable ruby. 2019-10-10 16:17:06 +01:00
Mike McQuaid
67f960ba67 GitHub Actions CI
Try to setup GitHub Actions CI.
2019-08-19 20:38:19 +01:00
Mike McQuaid
1d62067883
test/spec_helper: handle needs_linux.
Add similar logic to that for macOS.
2019-07-28 14:11:29 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
aa44509be9
Test dev-cmd *_args methods
Also, add a few missing invocations.
2019-03-27 13:35:42 +00:00
Mike McQuaid
3bde17c9f9
Cleanup from dev-cmd test changes
- Remove added whitespace in `extend/os/linux/keg_relocate`
- Cleanup testball bottles
2019-03-27 10:31:26 +00:00
Mike McQuaid
59d680a626
dev-cmd: only one integration test per command.
Integration tests are useful in detecting breakages but much slower so
let's only use one per command and install formula outside the
integration test framework (which is also slow).
2019-03-27 09:45:48 +00:00
Mike McQuaid
17f3ee1957
Improve Bundler cleanup
Rather than trying to be smart and doing this ourselves in `brew cleanup` let’s just installed Bundler somewhere it doesn’t try to clean itself up and use `bundle install --cleanup` when we need cleanup done.

Also, use `ohai` and `odie` when possible as they look nicer.
2019-02-27 14:02:46 +00:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
5c7fbaf259
Update RuboCop RSpec rules
Create a new, seperate RuboCop file that uses our RSpec rule
configuration if a specified tap has a `spec` directory.

Also, while we're here, fix up the various rules so that we don't have
any outdated TODOs, disable some rules for good and fix `brew style`
for Homebrew/bundle.
2019-01-21 13:39:11 +00:00
Mike McQuaid
3c270b3a9a
spec_helper: tweak parallel tests handling.
- only hide filtered runs in parallel (where they are super noisy)
- only send SimpleCov coverage once to Coveralls
2019-01-09 18:59:12 +00:00