152 Commits

Author SHA1 Message Date
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
Mike McQuaid
61fa59e95b
Remove Travis CI specific code
We’re no longer using this for our CI so this is no longer necessary.

Also, migrate `brew tap-new` to use Azure pipelines.
2018-12-30 21:13:24 +00:00
Mike McQuaid
0de21812a7
Use Coveralls for coverage reporting. 2018-12-30 20:06:13 +00:00
Shaun Jackman
e8b22690a0 Fix Language::Java::java_home_env for Linux
/usr/libexec/java_home is specific to macOS.
Language::Java::java_home_cmd is not implemented on Linux and raises
NotImplementedError.

Add private Language::Java::java_home_shell and use it instead of java_home_cmd.
Add public Language::Java::java_home for use by formulae.
2018-11-29 12:50:31 -08:00
Shaun Jackman
a7ad7eee78 test/spec_helper: Fix :needs_svn
which("svn") detects shims/scm/svn even when svn is not installed.
2018-10-25 08:54:23 -07:00
Mike McQuaid
0617dc1c1d
info: make verbose analytics use tabular output.
This copies (and slightly improves) the current `brew formula-analytics`
output so `brew formula-analytics` can be adjusted to just output JSON.
2018-10-20 12:06:25 +01:00
Mike McQuaid
100e85dda1
Generate Cobertura coverage data for Azure Pipelines
These can be used and displayed directly in the Azure Pipelines GUI.

It may not end up replacing CodeCov but it's easy enough so: why not.
2018-10-13 17:55:04 -07:00
Mike McQuaid
9a698d2130
keg: further tweak directory constants.
- ensure that `HOMEBREW_CELLAR` is always created on `install`.
- remove the need for a special `PRUNEABLE_DIRECTORIES` variable
- reuse values from existing variables and get `uniq`s.
2018-09-25 22:03:29 +01:00
Mike McQuaid
59c858a8e8
Cleanup Travis and CI configuration.
Use the environment variables set by `brew test-bot`. Eventually we'll
disable Travis CI running CodeCov so move `TRAVIS` references to
`HOMEBREW_TRAVIS_CI` so it doesn't need whitelisted.

Also, fix `azure-pipelines.yml` so it's testing the correct version of
Homebrew/brew (the one checked out in the `pwd`).
2018-09-19 15:01:33 +01:00
alexbostock
122738709a Add a_json_string matcher and improve tests 2018-09-17 20:49:43 +01:00
Markus Reiter
943e227ca1 Retry all specs with :needs_network. 2018-09-14 16:57:14 +02:00
Mike McQuaid
7615d3a812
Improve writable directory handling
Consolidate the handling of which directories need to exist and which
need to be writable. Additionally, add a fatal check for formula
installations to ensure that any directories that need to be writable
are so before attempting an installation.

Fixes #4626.
2018-09-06 18:38:43 +01:00
Shaun Jackman
879f514e28 test/unpack_strategy: Handle svn unzip unavailable
Skip those tests that require svn or unzip.
2018-08-13 14:41:00 -07:00
Markus Reiter
5841b992ac Refactor $LOAD_PATH. 2018-07-17 23:38:57 +02:00
Markus Reiter
1f56314365 Clear Tap cache before each example. 2018-07-16 10:55:22 +02:00
Markus Reiter
e07eddc391 Simplify Hbc::SystemCommand::Result#plist. 2018-07-05 10:54:35 +02:00