100 Commits

Author SHA1 Message Date
cnnrmnn
02993c5899 Update tests to stop passing full_clone 2021-05-06 10:11:21 -04:00
Mike McQuaid
6f071a06f8
Use JSON.pretty_generate
It's dramatically more human readable for very little difference in
space.
2021-04-09 15:44:37 +01:00
Nanda H Krishna
f648b071ad
dev-cmd/tap-new: use Utils::Git.setup_gpg! 2021-04-02 17:21:26 +05:30
Mike McQuaid
dc1fdc9f8d
Speedup brew --version.
Port `brew --version` to Bash to speed it up.

While we're here:
- remove (now) unused `Tap` Git methods
- use `--quiet` instead of `-q` to be more verbose

Benchmarks:
```
$ hyperfine --min-runs=3 --warmup=2 "git checkout origin/master; brew --version" "git checkout speedup_brew_version; brew --version"
Benchmark #1: git checkout origin/master; brew --version
  Time (mean ± σ):      2.083 s ±  0.004 s    [User: 396.8 ms, System: 597.2 ms]
  Range (min … max):    2.080 s …  2.088 s    3 runs

Benchmark #2: git checkout speedup_brew_version; brew --version
  Time (mean ± σ):     847.9 ms ±  35.2 ms    [User: 100.0 ms, System: 247.9 ms]
  Range (min … max):   824.1 ms … 888.3 ms    3 runs

Summary
  'git checkout speedup_brew_version; brew --version' ran
    2.46 ± 0.10 times faster than 'git checkout origin/master; brew --version'
```
2021-03-04 12:59:42 +00:00
Bo Anderson
a5b12a33c2
utils/gems: use Gem API rather than ENV to set paths 2021-02-27 16:23:28 +00:00
Bo Anderson
6cd1e5e384
Avoid passing around a massive $LOAD_PATH.
Portable Ruby crashes if the $LOAD_PATH gets too big.
2021-02-26 18:23:48 +00:00
Issy Long
83ead25229
rubocop: Disable RSpec/ContextWording for shared_context descs
- I couldn't figure out a way to start these with "when", "with" or
  "without" given where these are in cop descriptions. Three ignored
  things out of 150 problems is a good ratio though.
2021-02-19 23:31:17 +00:00
Seeker
2fc17772f7 bottle_spec: more cleanup 2020-12-25 13:10:10 -08:00
Michka Popoff
75491b7906 bottle --merge: add more write tests
In preparation for #9315
2020-12-23 10:34:16 +01:00
Seeker
cdb07d89ae integration_test: fix indentation for test formulae 2020-12-21 16:17:39 -08:00
Rylan Polster
f450bfbf5e style: migrate some lists back to Homebrew/brew 2020-12-02 20:56:07 -05:00
Rylan Polster
2256e547d9 Remove unneeded "formulae exist" test 2020-11-30 18:18:50 -05:00
Markus Reiter
da8d91bd05 Fix .simplecov exit status for integration tests. 2020-11-30 20:52:27 +01:00
Markus Reiter
d5b184d17a Add types for SystemCommand. 2020-11-23 05:48:43 +01:00
Markus Reiter
7c5d8a5288 Refactor FormulaInstaller. 2020-11-18 09:30:11 +01:00
Rylan Polster
50890ebd51 fix Lint/DuplicateBranch style 2020-11-16 02:02:52 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
5f005f67cf Refactor global Cask::Config. 2020-10-01 00:57:10 +02:00
Mike McQuaid
667c2b8804
Merge pull request #8382 from Bo98/startup-speedup
Lazily require some heavy files
2020-08-21 17:11:39 +01:00
Dawid Dziurla
c8c2e38bcb
Consistently use HOMEBREW_RUBY_WARNINGS when calling ruby
Adding this in `dev-cmd/ruby.rb` allows us to suppress warnings like:
```
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/language/python.rb:8: warning: Insecure world writable dir /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/scm in PATH, mode 040777
```
2020-08-20 14:59:58 +02:00
Bo Anderson
281632b64e test: ensure require "formula" isn't run on startup 2020-08-20 02:05:17 +01:00
Bo Anderson
e3372e2a14 Lazily require some heavy files 2020-08-20 02:05:17 +01:00
Markus Reiter
b48bc316e0 Use CLI::Parser for cask commands. 2020-08-13 05:15:15 +02:00
Markus Reiter
8a32954940 Move cask/all to just cask. 2020-08-09 01:34:07 +02:00
lionellloh
29622c35d1 tests: wrote up more tests for brew install 2020-07-07 21:34:49 +08:00
Mike McQuaid
0166211ffd
integration_test: don't error on missing bin. 2020-07-01 11:55:42 +01:00
Mike McQuaid
11cf77be17
formula_installer: prelude before fetch.
This ensures that dependencies are verified and tapped before they are
fetched. `FormulaInstaller#lock` has been moved into
`FormulaInstaller#install` to avoid locking until necessary.

While we're here, don't compute dependencies before fetching if we're
not going to use them.
2020-05-23 13:40:13 +01:00
Mike McQuaid
08a9f0e1c0
Use FormulaInstaller#fetch before #prelude. 2020-05-11 09:38:26 +01:00
Michelle Nguyen
2264c08cee
Fetch formula resources before unlinking during upgrade.
Fixes #6374.
2020-05-11 09:37:56 +01:00
Claudia
c85df70757
Fix flaw in Cask test helper
This commit fixes a flaw in the Cask test helper, causing the broken `Cask::Config` test to actually fail.

The flaw occurred while patching the `Cask::Config::DEFAULT_DIRS` hash.
While the original hash uses strings as values, the patched one used
`Pathname` values, masking a broken `Cask::Config::from_json` test.

Now the broken test fails like it should.
2020-04-27 15:09:36 +02:00
Mike McQuaid
cddc67b451
rubocops/uses_from_macos: update list.
Also, provide details on how to update this in future and split it into
two.

Fixes #7396
2020-04-20 10:36:42 +01:00
Mike McQuaid
56c02485e0
rubocops: test whitelists. 2020-04-12 14:17:05 +01:00
Dario Vladovic
3a21ca8956
Implement mdimporter cask stanza 2020-04-06 15:24:14 +02:00
Bo Anderson
4265540cc4 load_path: trim entries where possible to fix Ruby crashes 2020-04-01 11:53:54 +01:00
Mike McQuaid
bd076049a0
integration_test: only run on system Ruby.
There appear to be random, seemingly impossible to debug issues with
running integration tests on portable Ruby. Instead of confusing
contributors when these will be run on CI anyway: let's just skip them
by default (like we do with `--online` for online tests anyway).
2020-03-30 20:25:42 +01:00
Mike McQuaid
6670ae6202
global: require rubygems for activesupport. 2019-11-06 10:36:40 +00: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
8a8fc68264
Ruby 2.6.3 brew tests fixes 2019-10-08 17:39:31 +01:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
ef2e297d3b
Disable RubyGems by default.
This speeds up all Ruby invocations where we don't need RubyGems by
around 10%. Where we do need RubyGems: include it manually.
2019-04-18 17:45:03 +09:00
Mike McQuaid
1e5cfcc028
Separate tap tests into separate, correct files. 2019-03-27 13:35:42 +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
e095da4d01
rubocop: enable Layout/EmptyLineAfterGuardClause. 2019-02-21 12:55:49 +00:00
Markus Reiter
78d4373543 Simplify DEFAULT_DIRS. 2019-02-15 10:09:14 +01:00
Markus Reiter
fda6e0cab3 Split cask config into three tiers. 2019-02-15 10:09:14 +01:00
Markus Reiter
1e1ce1c471 Save config file for casks. 2019-02-15 10:09:14 +01:00
Claudia
5be80a78f6
Use Homebrew-controlled domain for Cask dummy URLs
In a number of Cask specs, the value of the `homepage` stanza is currently set
to https://example.com. As of 2018-11-28, the TLS certificate served by
example.com seems to be expired, possibly due to an oversight on ICANN’s side.

While the certificate is certainly going to be renewed soon, it would be
desirable for Homebrew’s test result to be less dependent on ICANN’s actions.
This commit changes the homepages of all test Casks to http://brew.sh, whose
domain and TLS certificate are both controlled by Homebrew.
2018-11-28 20:51:55 +01:00
Markus Reiter
cea9942a1d Fix code style. 2018-11-13 05:04:35 +01:00
Claudia
7b320fc03b
Move shared Cask examples closer to its clients
In Cask specs, we have recently introduced a couple of specialized
`shared_examples` directories. Those new directories are organized
below their respective packages (for instance,
`cask/artifact/shared_examples` and `cask/cmd/shared_examples`).

This commit moves the rest of the shared examples accordingly.

See also:
https://github.com/Homebrew/brew/pull/5247
2018-11-06 07:19:41 +01:00