311 Commits

Author SHA1 Message Date
apainintheneck
5c41e85ae9 update cmd/uses and cmd/deps tests
These tests were very simple before and now this should result
in more code coverage without affecting test performance.

The only tricky thing was testing the `--missing` option without
actually installing a package using `install_test_formula` because
that is very slow (around 10 seconds on my machine). I ended
up just writing the tab to a plausible keg directory for each
package I wanted to "install". This allows us to test the behavior
while also not increasing CI time by ~20 seconds (though it'd
probably be faster on CI than my local machine).
2023-08-28 21:54:32 -07:00
Mike McQuaid
75dd070395
Remove Google Analytics
We are now entirely migrated to InfluxDB so can remove all GA code.
2023-06-16 10:33:15 +01:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Mike McQuaid
a743e9277f
workflows/tests: faster, more reliable tests.
- Extract update tests into separate tests.
- Make `brew tests --online` run only once in its own job. This job
  could be made non-required to fight flakiness.
- Split up the various macOS runs into several steps now that we have
  more parallel macOS workers available.
- Cleanup some flaky tests.
2023-02-17 15:26:18 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Douglas Eichelberger
bd62afde91 Resolve cmd/update-report_spec violation 2023-01-22 17:09:55 -08:00
Mike McQuaid
d1be288418
some needs_network specs: temporarily disable.
These are absurdly flaky right now so let's disable them.
2023-01-20 17:41:07 +00:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Bo Anderson
af234779af
test: support non-master init.defaultbranch 2022-10-07 18:44:03 +01:00
apainintheneck
a178fc6a88 Cleanup no cask on linux specs 2022-10-02 08:51:17 -07:00
apainintheneck
5d27b70757 Set --formula by default on linux 2022-10-01 17:28:07 -07:00
apainintheneck
020c50e588 Warn linux users about using --cask 2022-10-01 16:11:39 -07:00
Mike McQuaid
c7bd51b995
Merge pull request #13844 from troymccabe/feature/13834-brew-docs-cmd
Adds `brew docs` to close #13834
2022-09-12 14:54:29 +01:00
Troy McCabe
ac9a96874e Adds brew docs to close #13834 2022-09-11 22:10:37 -05:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01:00
Lukas Oberhuber
2c829380b5 Test that --debug-symbols succeeds
Due to limitations of the test framework, this only tests
that the command with the --debug-symbols
flag succeeds and that on MacOS the `dsymutil` is run.
2022-08-11 10:54:18 -10:00
Lukas Oberhuber
3d60d610dd Merge branch 'master' into debug-symbols 2022-08-10 18:44:09 -10:00
Lukas Oberhuber
aa2682a098 These tests don't test anything
On MacOS, the compile flags `-g` are not set, and I can't figure out
how to set them here. `dsymutil` runs successfully regardless of if
there are debug symbols or not.
Same on linux therefore the test cannot succeed.
2022-08-10 16:55:19 -10:00
Lukas Oberhuber
19a66e75c4 Second try at objdump call for linux 2022-08-06 10:06:32 -07:00
Lukas Oberhuber
f930dd58a0 Fix style 2022-08-05 17:02:10 -07:00
Lukas Oberhuber
683bcd92b0 Attempted linux test 2022-08-05 16:54:32 -07:00
apainintheneck
d04051a9b9 Add integration tests for autoremove cmd 2022-08-02 18:20:38 -07:00
Lukas Oberhuber
89c1d6812d Test sources are dropped in HOMEBREW_CACHE/Sources 2022-08-02 09:06:28 -07:00
Lukas Oberhuber
fdf17f06b1 Test for dSYM directory on Mac 2022-08-01 16:30:00 -07:00
Lukas Oberhuber
bee3531090 Improve style 2022-08-01 15:25:34 -07:00
Lukas Oberhuber
15f1ac8775 Integration test for --debug-symbols
But only checks that the command works. Not that `dsymutil` is called
or that `-g` is added to the compile args.

(Not sure how to do either in an integration test.)
2022-07-30 11:23:40 +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
04c8e02418
cmd/update-report: use better wording where appropriate.
From reading https://github.com/orgs/Homebrew/discussions/3328: I
initially thought we should just change "Updated" to "Modified" when
appropriate. After conversation with Bo98, though, I thought more and
saw that we're already checking for outdated formulae here so, rather
than ever traverse through the formula history, look at the outdated
formula and list them unless we've set
`HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the
modifications.

While we're here, also do a bit of reformatting and renaming to better
clarify intent.
2022-06-03 19:23:38 +01:00
Mike McQuaid
d48a9337e4
Revert "update-report: default HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED to on." 2022-02-28 09:54:12 +00:00
Mike McQuaid
10d5266361
update-report: default HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED to on.
This avoids reading formula files that the user hasn't explicitly
installed which both speeds up `brew update` and improves the security.
2022-02-22 10:01:24 +00:00
Mike McQuaid
0b9df6db62
test/cmd/services_spec: fix test.
Was broken by https://github.com/Homebrew/homebrew-services/pull/443
2022-01-21 13:52:22 +00:00
Rylan Polster
41b0bf7bbb
Add developer command 2021-07-14 01:55:00 -04:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01: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
Adrian Ho
548316ecc8 --prefix: shortlist only formulae 2021-03-11 17:32:35 +08:00
Mike McQuaid
e9419dbce7
test/cmd: test Bash logic. 2021-03-04 12:59:43 +00:00
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
Mike McQuaid
ca47b47f77
Speedup brew --prefix <formula>
This case is _really_ slow even although it's something we encourage
people to run often and build systems often do. The `brew --prefix`
case is really fast because it's just in Bash so: let's pull the
`brew --prefix <formula>` case into Bash too.

This doesn't handle any edge-cases like `--installed` and the formula
detection is pretty simple.

Also, to make this behaviour consistent, never output `Cellar` paths
from the (Ruby) `brew --prefix`; we never want people relying on the
Cellar paths anyway, only output them if the formula wasn't installed
(where, arguably, using a Cellar path is even worse) and the speedup is
worth this deviation in behaviour.
2021-02-25 17:07:28 +00:00
Rylan Polster
4a82d807e1
style: remove RSpec/MultipleDescribes violations in commands 2021-02-01 20:30:51 -05:00
Rylan Polster
af40e072b0
style: remove RSpec/NamedSubject violations 2021-02-01 20:30:51 -05:00
Mike McQuaid
cdf8ff9052
Merge pull request #10266 from gromgit/prefix_non_installed
cmd/--prefix: add --installed flag
2021-02-01 09:05:28 +00:00
Adrian Ho
28a8409b6e cmd/--prefix: add --installed flag
This changes the output for uninstalled formulae from Cellar prefix to empty string, so:
```sh
$ brew --prefix abcde python@3.9 tcl-tk
/usr/local/Cellar/abcde/2.9.3_1
/usr/local/opt/python@3.9
/usr/local/Cellar/tcl-tk/8.6.10
$ brew --prefix --installed abcde python@3.9 tcl-tk

/usr/local/opt/python@3.9

$
```
2021-01-31 16:09:43 +08:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
Seeker
1ce8bd00fb named_args: print error if formula and cask found but one is unreadable 2021-01-28 15:21:23 -08:00
Rylan Polster
4b8477ba70 Completions, Settings: move to Homebrew namespace 2021-01-13 11:20:28 -05:00