399 Commits

Author SHA1 Message Date
Douglas Eichelberger
12d32cc69e Manual fixes 2024-02-11 20:13:24 -08:00
Markus Reiter
d1fa91cd78
Clear tap caches after linking cask fixtures. 2024-02-09 23:37:11 +01:00
Markus Reiter
d42f419217
Don't use slashes when loading casks in tests. 2024-02-09 23:17:25 +01:00
Markus Reiter
d9263196a2
Never link outdated cask fixtures. 2024-02-09 22:04:26 +01:00
Razvan Azamfirei
82cdf27eb8
fixture/cask: fix style violations 2024-01-28 10:19:39 -05:00
Issy Long
a6b8a795b4
Merge pull request #16365 from issyl0/rubocop-cask-zap-arrays-alphabetical
Add a new RuboCop for alphabetizing `zap trash` array elements
2024-01-24 21:34:18 +00:00
Issy Long
693a27d48b
Treat zap and uninstall the same
- Since `zap` can have more than just `trash`.
2024-01-21 19:48:30 +00:00
Issy Long
8910d5a479
Remove the single-element array in everything.json used for Cask tests
```
  1) Cask::Cask#to_h when loaded from cask file returns expected hash
     Failure/Error: expect(JSON.pretty_generate(hash)).to eq(expected_json)

Diff:
       @@ -28,9 +28,7 @@
              "uninstall": [
                {
                  "launchctl": "com.every.thing.agent",
       -          "delete": [
       -            "/Library/EverythingHelperTools"
       -          ],
       +          "delete": "/Library/EverythingHelperTools",
                  "kext": "com.every.thing.driver",
                  "signal": [
                    [
       @@ -103,7 +101,7 @@
          ],
          "ruby_source_path": "Casks/everything.rb",
          "ruby_source_checksum": {
       -    "sha256": "b2707d1952f02c3fa566b7ad2a707a847a959d36f51d3dee642dbe5deec12f27"
       +    "sha256": "0c4af571cce1632fc6a3dcf3e75ba82a3283077ef12399428192c26f9d6f779b"
          }
        }
     # ./test/cask/cask_spec.rb:225:in `block (4 levels) in <top (required)>'
     # ./test/support/helper/spec/shared_context/homebrew_cask.rb:53:in `block (2 levels) in <top (required)>'
```
2024-01-21 01:32:15 +00:00
Issy Long
2c9e6e425b
Autofix Cask/ArrayAlphabetization offenses in test fixtures 2024-01-14 20:57:08 +00:00
Douglas Eichelberger
0852e1d7b6 Refactor away String#indent 2024-01-08 13:36:45 -08:00
Rylan Polster
254fcf7c1f
Update livecheck test fixtures to use deprecate! and disable! 2023-12-17 16:31:04 -05:00
Rylan Polster
40d3ab6a5d
Add tests and fix brew typecheck 2023-12-16 20:01:47 -05:00
Bo Anderson
89531e9ff3
Update all dependencies 2023-12-15 16:24:46 +00:00
Bo Anderson
fb21d59b5a
Improve coverage tracking 2023-11-11 05:36:40 +00:00
Mike McQuaid
54012f14ce
cask: add installed_time to JSON output.
This is provided for formulae in `installed.time` and is useful to have
for casks as well as formulae so let's output it here too.
2023-11-03 11:37:01 +00:00
Bo Anderson
14c1dce38b
Allow HOMEBREW_RUBY3 in tests 2023-10-27 15:58:43 +01:00
Bo Anderson
af7d744af0
Fixes for Ruby 3 2023-09-29 05:25:48 +01:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
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
Douglas Eichelberger
d01cda2815 Turn up the types 2023-08-12 22:01:22 -07:00
Mike McQuaid
22553cd34a
Fix cask sharding issues
- Fix cask info output being incorrect
- Improve some code referring to casks as formulae
- Move livecheck cask fixtures to not shadow existing names
- Adjust the cask tap symlinking logic to make handling outdated
  shadowed casks significantly easier
- Fix various flaky tests caused by casks sharding logic
- Prefer longer paths when there's multiple formulae or casks in a tap
  with the same name rather than always using the first
2023-08-10 16:08:47 +01:00
Mike McQuaid
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
Bo Anderson
f504b92c45
Preliminary macOS 14 (Sonoma) support 2023-06-05 23:21:11 +01:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Mike McQuaid
0e387fee8c
Merge pull request #15138 from JBYoshi/cask-move-contents
Don't remove cask directories when upgrading.
2023-05-04 11:43:44 +01:00
Ilya Kulakov
6a4322833f sudo: Fix tests. 2023-04-28 11:22:54 -07:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01:00
JBYoshi
a1571702d3
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-25 15:44:29 -05:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07: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
apainintheneck
1322b9cb79 cask: remove os_versions
This was originally used by the API but was replaced months
ago by SimulateSystem. Essentially, it's only current use
was in the #to_h method but is not used internally at all
when creating cask instances from the API JSON.
2023-04-16 13:52:24 -07:00
JBYoshi
2e85f2beb2
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-15 21:37:56 -05:00
Markus Reiter
3275b927b8
Make test not depend on macOS version. 2023-04-11 21:02:10 +02:00
Issy Long
6536b641f4
Fix ruby_source_path in Ventura systemsettings-caveats fixture JSON
- Cask source paths were added to the API in 844db75361. The main
  `everything.json` file was updated with the new data in that commit,
  but this one was missed causing local test failures.

Before:

```
Cask::Cask#to_h when loaded from cask file returns expected hash
  Failure/Error: expect(JSON.pretty_generate(hash)).to eq(expected_json_after_ventura)
    [...]

    Diff:
    @@ -93,7 +93,7 @@
        "en",
        "eo"
      ],
    -  "ruby_source_path": "Formula/everything.rb",
    +  "ruby_source_path": "Casks/everything.rb",
      "ruby_source_checksum": {
        "sha256": "b2707d1952f02c3fa566b7ad2a707a847a959d36f51d3dee642dbe5deec12f27"
      }

  # ./test/cask/cask_spec.rb:231:in `block (4 levels) in <top (required)>'
  # ./test/support/helper/spec/shared_context/homebrew_cask.rb:52:in `block (2 levels) in <top (required)>'
```
2023-04-11 00:33:11 +01:00
JBYoshi
9fedaee462
Only keep empty directories when the new version also has them. 2023-04-08 16:13:12 -05:00
Markus Reiter
844db75361
Add source paths to API. 2023-04-07 15:20:01 +02:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
Issy Long
039a434936
Merge pull request #14976 from issyl0/rubocop-cask-on-arch-block-order
rubocops/cask: Enforce the order of `on_#{arch}` blocks
2023-03-29 12:10:37 +01:00
Markus Reiter
3da305fa80
Add keyboard_layout stanza. 2023-03-26 08:14:24 +02:00
Issy Long
0af5825dfb
rubocops/cask: on_#{os_version} is after [version & sha256] group
- This still doesn't pass `brew readall` for Casks, but it gets us a
  little closer since if `url` has a `version` interpolated in it, the
  `version` stanza has to come first.
- See https://github.com/Homebrew/homebrew-cask/pull/143201 for the
  current failures.
2023-03-25 16:02:30 +00:00
Issy Long
ebdd408f99
test/fixtures: Put the on_system blocks in oldest => newest order 2023-03-21 22:51:23 +00:00
Issy Long
1e18e88c68
test/fixtures: Fix style for the new Cask/NoOverrides cop 2023-03-21 22:51:21 +00:00
Issy Long
865e99c611
test/cask: Rename 'expected_json_ventura' since it's >= Ventura
- Let's actually show in the fixtures JSON filename what's changed
  between the two.
2023-03-18 15:16:23 +00:00
Issy Long
6b4b923b44
test/cask: Fix "System Settings" caveats for (non-)Ventura OSes
- "System Preferences" was updated to be "System Settings" in macOS
  Ventura. This naming was updated in our caveats generator in PR 14997.
- This test was failing for me locally (on Ventura) because it was
  hardcoded to expect `System Preferences => Security & Privacy`, but
  getting `System Settings => Privacy & Security`.
- This is not the most important thing in the world, we can probably
  live with the failing test, but I thought I'd try to fix it anyway.
2023-03-18 13:19:20 +00:00
Douglas Eichelberger
4d32699f61 Placate rubocop 2023-03-14 23:01:09 -07:00
Issy Long
6a704f2f40
sorbet: Bump more files to typed: true
- This was done through the `brew typecheck --suggest-typed --update`
  command.
2023-03-05 18:18:59 +00:00
apainintheneck
9087afba74 Add baseline test for Cask#to_h
Also, added a test for loading JSON files in the cask loader.
2023-02-28 21:43:02 -08:00