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
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.
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
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.
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
Layout/InconsistentIndentation once the auto-fixer had got rid of the
"redundant begin"s.
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).
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.
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.