Issy Long
1daeb5bee0
Set up the debug
gem for test debugging
...
- This processed that we'd requested a debugger, but didn't drop us into
a debugging console until I
[stopped the stdin disablement](https://github.com/Homebrew/brew/issues/16708#issuecomment-1953483970 ).
Usage:
```
❯ git diff
diff --git a/Library/Homebrew/test/migrator_spec.rb b/Library/Homebrew/test/migrator_spec.rb
index 87fadd5e95..db4700810a 100644
--- a/Library/Homebrew/test/migrator_spec.rb
+++ b/Library/Homebrew/test/migrator_spec.rb
@@ -69,6 +69,8 @@ RSpec.describe Migrator do
tab.source["tap"] = "homebrew/core"
tab.write
+ binding.break
+
expect do
described_class.new(new_formula, "oldname")
end.to raise_error(Migrator::MigratorDifferentTapsError)
issyl0 at pictor in /opt/homebrew on bye-byebug
❯ brew tests --only=migrator --debug
Randomized with seed 59158
1 process for 1 spec, ~ 1 spec per process
.==> Relinking newname
.==> Unlinking oldname
...==> Moving oldname versions to /private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/newname
....==> Migrating formula oldname to newname
==> Unlinking oldname
==> Moving oldname versions to /private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/newname
==> Relinking newname
....[67, 76] in ~/migrator_spec.rb
67| tab = Tab.empty
68| tab.tabfile = HOMEBREW_CELLAR/"oldname/0.1/INSTALL_RECEIPT.json"
69| tab.source["tap"] = "homebrew/core"
70| tab.write
71|
=> 72| binding.break
73|
74| expect do
75| described_class.new(new_formula, "oldname")
76| end.to raise_error(Migrator::MigratorDifferentTapsError)
=>#0 block in <top (required)> (3 levels) at ~/migrator_spec.rb:72
#1 [C] BasicObject#instance_exec at /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:263
# and 68 frames (use `bt' command for all frames)
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p tab
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p # command(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p # command t # command ta # command tab # command(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p tab # command
=> #<Tab:0x0000000107156be0 @aliases=[], @arch=nil, @built_as_bottle=false, @built_on={"os"=>"Macintosh", "os_version"=>"macOS 14", "cpu_family"=>"arm_firestorm_icestorm"}, @compiler=:clang, @homebrew_version="4.2.16-55-gc8f60ec-dirty", @installed_as_dependency=false, @installed_on_request=false, @loaded_from_api=false, @poured_from_bottle=false, @runtime_dependencies=nil, @source={"path"=>nil, "tap"=>"homebrew/core", "tap_git_head"=>nil, "spec"=>"stable", "versions"=>{"stable"=>nil, "head"=>nil, "version_scheme"=>0}}, @source_modified_time=0, @stdlib=nil, @tabfile=#<Pathname:/private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/oldname/0.1/INSTALL_RECEIPT.json>, @time=nil, @unused_options=[], @used_options=[]>
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464)
```
2024-04-17 22:25:12 +01:00
Issy Long
11c1960729
Remove byebug
since it doesn't work in tests anymore
...
- Byebug was introduced in [2020](https://github.com/Homebrew/brew/pull/7577 ) for hooking into tests for debugging.
- It does not work anymore in so far as it does not stop at breakpoints when following the instructions to trigger them in tests.
2024-04-17 22:24:21 +01:00
Ruoyu Zhong
0df71ea6a3
utils/github: support globbing artifacts
2024-04-17 03:34:42 +08:00
Ruoyu Zhong
852c5acb65
Revert "os/linux/elf: avoid using ldd for listing dynamic dependencies"
2024-04-16 02:50:12 +08:00
Mike McQuaid
c44bf6f432
Merge pull request #16817 from cho-m/virtualenv-basic-resource-order-args
...
language/python: order args for `virtualenv_install_with_resources`
2024-04-15 08:37:08 +01:00
Michael Cho
ecb7daba58
language/python: order args for virtualenv_install_with_resources
...
Add `without`, `start_with`, and `end_with` to allow basic control over
the order that resources are installed so that the situations where we
have to split up `virtualenv_install_with_resources` is reduced.
Co-authored-by: Kevin <apainintheneck@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-14 22:21:32 -04:00
Caleb Xu
c6b98d0b8c
os/linux/ld: add functions for querying dynamic linker
2024-04-13 19:35:29 -04:00
Caleb Xu
4b0e950736
utils/path: add child_of? method
2024-04-13 19:35:29 -04:00
Mike McQuaid
c683e011b8
Merge pull request #17049 from trail-of-forks/ww/attestation
...
attestation: add initial attestation helpers, integrate into `brew install`
2024-04-12 15:52:51 +01:00
William Woodruff
1607d04ad2
test: add Bottle#filename
test
...
Signed-off-by: William Woodruff <william@yossarian.net>
2024-04-12 10:41:55 -04:00
William Woodruff
faa00c8c79
handle backfilled attestation subjects correctly
...
Signed-off-by: William Woodruff <william@yossarian.net>
2024-04-11 16:44:57 -04:00
William Woodruff
e2b5d93198
more attestation coverage
...
Signed-off-by: William Woodruff <william@yossarian.net>
2024-04-11 13:39:13 -04:00
Issy Long
c72598d937
Test that EnvConfig::ENVS
hash keys are alphabetical
...
- Spoiler: they aren't.
- As part of Volunteer Month at work I introduced `hharen` to contributing to
Homebrew, `cd $(brew --repo)`, `brew tests`, `brew style`, etc.
- We started to write a RuboCop for this. But my current thinking is that this
test might be sufficient since it might be easier to notice "oop, a test is
failing and I've added a new envvar" and re-alphabetize it than to write a
RuboCop linter for it to do the one-time autofix. Considering how little this
gets changed?
Co-authored-by: Hana <hharen@github.com>
2024-04-11 17:58:08 +01:00
William Woodruff
480e48b75d
attestation_spec: simplify gh_executable test
...
Signed-off-by: William Woodruff <william@yossarian.net>
2024-04-10 18:02:56 -04:00
William Woodruff
990b7d77d6
attestation: fix a missing arg, add initial specs
...
Signed-off-by: William Woodruff <william@yossarian.net>
2024-04-10 17:57:01 -04:00
Mike McQuaid
1474806527
Add more HOMEBREW_FORBIDDEN_*
configuration
...
We already had `HOMEBREW_FORBIDDEN_LICENSES` but this commit adds
`HOMEBREW_FORBIDDEN_CASKS`, `HOMEBREW_FORBIDDEN_FORMULAE` and
`HOMEBREW_FORBIDDEN_TAPS` for also forbidding those.
Relatedly, add `HOMEBREW_FORBIDDEN_OWNER` and
`HOMEBREW_FORBIDDEN_OWNER_CONTACT` to allow customising these
messages.
There were no existing tests for `HOMEBREW_FORBIDDEN_LICENSES` so have
added more tests for all of these checks.
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-04-08 16:38:32 +01:00
Douglas Eichelberger
8d1fa05530
Restrict AbstractCommand test to commands in repo
2024-04-04 09:48:17 -07:00
Kevin
044e48b816
Merge pull request #17012 from Homebrew/move-untap-module-into-cmd
...
cmd/untap: move module methods back into the cmd
2024-04-03 22:16:13 -07:00
apainintheneck
2d47193d22
cmd/untap: move module methods back into the cmd
...
The extra module was their to facilitate testing but now that
everything is properly namespaced and each command is an instance
we can just move the methods into the command. Since it's an
instance now we don't need to be as careful about caching either.
2024-04-03 22:06:19 -07:00
Douglas Eichelberger
f664433b5c
Enable RSpec/DescribeClass
2024-04-03 09:12:47 -07:00
Douglas Eichelberger
8ebcadd1c9
Clean up args_parse tests
2024-04-02 12:19:14 -07:00
Douglas Eichelberger
3f856f6516
Port Homebrew::Cmd::Repository
2024-04-01 16:02:41 -07:00
Douglas Eichelberger
6a1d43337c
Port Homebrew::Cmd::Prefix
2024-04-01 16:00:47 -07:00
Douglas Eichelberger
b56e0b733d
Port Homebrew::Cmd::Env
2024-04-01 15:58:07 -07:00
Douglas Eichelberger
754151fcb8
Port Homebrew::Cmd::Cellar
2024-04-01 15:56:06 -07:00
Douglas Eichelberger
102051c35d
Port Homebrew::Cmd::Caskroom
2024-04-01 15:54:03 -07:00
Douglas Eichelberger
7bbf0a3206
Port Homebrew::Cmd::Cache
2024-04-01 15:53:56 -07:00
Douglas Eichelberger
fdc95d02c8
Port Homebrew::Cmd::Uses
2024-04-01 12:01:37 -07:00
Douglas Eichelberger
1362890f2a
Port Homebrew::Cmd::Upgrade
2024-04-01 11:58:35 -07:00
Douglas Eichelberger
d5add6565c
Port Homebrew::Cmd::UpdateReport
2024-04-01 11:58:20 -07:00
Douglas Eichelberger
48f4adad33
Port Homebrew::Cmd::Untap
2024-04-01 11:50:25 -07:00
Douglas Eichelberger
f8caae06f7
Port Homebrew::Cmd::Unpin
2024-04-01 11:48:40 -07:00
Douglas Eichelberger
5ccb0b0567
Port Homebrew::Cmd::Unlink
2024-04-01 11:47:18 -07:00
Douglas Eichelberger
4cf9ef831a
Port Homebrew::Cmd::Uninstall
2024-04-01 11:46:01 -07:00
Douglas Eichelberger
841cfd9fdc
Port Homebrew::Cmd::Tap
2024-04-01 11:43:52 -07:00
Douglas Eichelberger
be42d46d49
Port Homebrew::Cmd::TapInfo
2024-04-01 10:15:28 -07:00
Douglas Eichelberger
5495ff1eea
Port Homebrew::Cmd::Search
2024-04-01 10:12:52 -07:00
Douglas Eichelberger
d875c970e9
Port Homebrew::Cmd::Reinstall
2024-04-01 10:09:48 -07:00
Douglas Eichelberger
057f561d2c
Port Homebrew::Cmd::Readall
2024-04-01 10:05:02 -07:00
Douglas Eichelberger
5ef070380c
Port Homebrew::Cmd::RbenvSync
2024-04-01 10:04:06 -07:00
Douglas Eichelberger
6c260db277
Port Homebrew::Cmd::PyenvSync
2024-04-01 10:01:54 -07:00
Douglas Eichelberger
427b527335
Port Homebrew::Cmd::Postinstall
2024-04-01 09:59:47 -07:00
Douglas Eichelberger
31aa89aa7c
Port Homebrew::Cmd::PostgresqlUpgradeDatabase
2024-04-01 09:48:23 -07:00
Douglas Eichelberger
c1b1c11a8c
Port Homebrew::Cmd::Pin
2024-04-01 09:44:14 -07:00
Douglas Eichelberger
7725fc62d4
Port Homebrew::Cmd::Outdated
2024-04-01 09:42:31 -07:00
Douglas Eichelberger
57442ab67e
Port Homebrew::Cmd::Options
2024-04-01 09:15:58 -07:00
Douglas Eichelberger
c5dfac1f2c
Port Homebrew::Cmd::NodenvSync
2024-04-01 09:15:58 -07:00
Douglas Eichelberger
a43224cb4a
Port Homebrew::Cmd::Missing
2024-04-01 09:15:58 -07:00
Douglas Eichelberger
0cb608a80c
Port Homebrew::Cmd::Migrate
2024-04-01 09:15:58 -07:00
Douglas Eichelberger
59adde2069
Port Homebrew::Cmd::Log
2024-04-01 09:15:58 -07:00