-
Notifications
You must be signed in to change notification settings - Fork 72
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
[REQ] Add option to "silent" the output #643
Comments
I was exploring this issue and thought of a way to implement this , I was hoping to use a bool like using a conditional at this block of code eg.Go(func() error {
// not using shared context to not disrupt display but let us finish reporting errors
mode := progressui.AutoMode
if log.GetLevel() >= log.DebugLevel {
mode = progressui.PlainMode
}
display, err := progressui.NewDisplay(os.Stderr, mode)
if err != nil {
return err
}
_, err = display.UpdateFrom(ctx, buildChannel)
return err
}) Please point me in the right direction and assign me this issue if I'm correct. |
@shishir-11 yes, I think a flag like |
@ashnamehrotra I've opened a PR which will hopefully solve this issue , please take a look at it , thank you. |
I was trying to add some tests for the new flag I made and some other flags but I run into some docker related issues with authorization , do you know how to bypass them , if possible that would allow me to write tests for more flags.
I get this error when i try to use -i flag . |
@shishir-11 where are you getting this error and what does the setup look like before calling copa? |
I was trying to extend the tests in {
name: "Silent flag check",
args: []string{"-r", "trivy.json", "-t", "3.7-alpine-patched", "-i", "images/python:3.7-alpine", "--silent"},
....
}, I modified the struct a bit to give it some more fields but this part was giving me the error. |
@shishir-11 I am not able to recreate this error. I am not sure if we should test this in cmd_test.go since we are not actually running copa here, just checking for the error when the required image argument is not provided. We will not be able to do the same for the silent command which requires copa to run. |
How can we write tests for other flags then, I think it would be beneficial if the code coverage was improved by adding more tests. |
@shishir-11 To add a check here, you would need to ensure copa can run in the workflow and check for expected log output to match something like |
What kind of request is this?
Add option to silent copa patch and buildkit output.
What is your request or suggestion?
No response
Are you willing to submit PRs to contribute to this feature request?
The text was updated successfully, but these errors were encountered: