93 Commits

Author SHA1 Message Date
Mike McQuaid
77c0d38c35
brew style --fix 2022-12-13 11:37:06 +00:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Mike McQuaid
bfd2263425
integration_test: fix Bundler deprecation.
Otherwise in some configurations some tests will fail.
2022-10-20 13:33:27 +01:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01:00
Mike McQuaid
0cda6a0657
Only use patchelf.rb
Remove support for using the `patchelf` formula for writing as it's been
off by default for a long time now.
2021-10-19 15:15:56 +01:00
Rylan Polster
27ba803bb5
Remove need for HOMEBREW_NO_DEV_CMD_MESSAGE 2021-07-20 11:47:31 -04:00
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
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
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