New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/list: support listing formulae installed on request or automatically #17125
Conversation
Sample usage: $ brew ls --manual gcc llvm [...] $ brew ls --auto grpc protobuf [...] $ brew ls --manual --auto gcc: manual grpc: auto llvm: manual protobuf: auto [...] Resolves #17117.
On a related note, this logic is extracted from a local command The reason I wrote it is mainly because After a quick search I do see previous request for such functionality (e.g., #10754), but that was not implemented in the end. I'd like to raise this to see if there is still interest in this; if so, I can prepare a PR for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @ZhongRuoyu! Happy to be self-merged once the naming is updated (or we can discuss more)
@@ -18,4 +34,25 @@ | |||
.and not_to_output.to_stderr | |||
.and be_a_success | |||
end | |||
|
|||
it "lists the formulae installed on request or automatically", | |||
:integration_test do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think it's worth adding another (slow, sadly) integration test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tangential: Now that each command is a separate class, do you think it'd be possible to create integration-like tests that don't require spinning up a new Ruby process? It might have been possible before but now it seems like a more viable option. Most of the slowness has to do with shelling out to a new Ruby process, right?
CC: @dduugg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apainintheneck Yeh, I think this would be nice.
We still want to make sure we have some proper/slow integration coverage because it catches when the issues are in bin/brew
or bin/brew.rb
but that could be a smaller subset of critical commands e.g. brew install
/brew upgrade
/etc.
Yeh, seems like a good idea. Not sure |
@@ -18,4 +34,25 @@ | |||
.and not_to_output.to_stderr | |||
.and be_a_success | |||
end | |||
|
|||
it "lists the formulae installed on request or automatically", | |||
:integration_test do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tangential: Now that each command is a separate class, do you think it'd be possible to create integration-like tests that don't require spinning up a new Ruby process? It might have been possible before but now it seems like a more viable option. Most of the slowness has to do with shelling out to a new Ruby process, right?
CC: @dduugg
tab = Tab.new( | ||
"installed_on_request" => installed_on_request, | ||
"tabfile" => keg_dir/Tab::FILENAME, | ||
) | ||
tab.write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tangential: This is starting to crop up in the test code a bit more and I'm wondering if it'd be better to just add an option to setup_test_formula
that facilitates that like with_tab: { "installed_on_request" => true }
.
CC: @reitermarkus because we've talked about this a bit before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apainintheneck good idea 👍🏻
3735761
to
3e57a49
Compare
3e57a49
to
90b629d
Compare
90b629d
to
0084791
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @ZhongRuoyu!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Sample usage:
Resolves #17117.