Skip to content
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

Only show traces for failures #831

Open
wtait1-ff opened this issue May 31, 2023 · 2 comments
Open

Only show traces for failures #831

wtait1-ff opened this issue May 31, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@wtait1-ff
Copy link

It would be nice if the new conftest test --quiet ... flag courtesy of #785 also applied when --trace is given. It's an improvement to find the failed policy evaluations more quickly with --quiet, but having trace output for all evaluations still gives a lot to dig through before fixing the failure.

@jalseth jalseth added the enhancement New feature or request label Jun 2, 2023
@boranx
Copy link
Member

boranx commented Jun 2, 2023

Isn't this the current behavior already? https://github.com/open-policy-agent/conftest/blob/master/internal/commands/test.go#L139-L143
For instance: the following hides all logs when the result is success

./conftest test -p examples/kubernetes/policy/pass.rego examples/kubernetes/deployment.yaml --quiet --trace

@wtait1-ff
Copy link
Author

Ahh, I see that I was misunderstanding --quiet a bit. I thought for all output formats, if there were any failures, only the failures would be shown. But I see for example --output table, that both successes + failures are still shown.

With all the output formats it's still somewhat quick to find which policies failed on which configs. But --trace is different as it seems to override whatever --output was given. And more importantly if you have a lot of policies and/or configs under test (in my case it's both, so quite a multiplication factor), a lot of trace output will be produced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants