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

Conftest does not output detailed summary report #872

Open
blazerrt86899 opened this issue Sep 27, 2023 · 1 comment
Open

Conftest does not output detailed summary report #872

blazerrt86899 opened this issue Sep 27, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@blazerrt86899
Copy link

When running conftest test -o json >results.json , It is giving output only success count.
How do I get a detailed output summary.

  1. How many test cases ran
  2. How many success and details about it
  3. How many failed and details about it
@boranx boranx added the enhancement New feature or request label Oct 4, 2023
@boranx
Copy link
Member

boranx commented Oct 4, 2023

I think that's because the "0" values are being omitted while the result set is being marshaled (https://github.com/open-policy-agent/conftest/blob/master/output/json.go#L37)
You might have already noticed total numbers and pretty-printing are done by the implementors of the various output types, and there are repetitive code-blocks that individually do this for each output type (like: https://github.com/open-policy-agent/conftest/blob/v0.46.0/output/standard.go#L99)
Therefore, we might consider exporting the common logic to re-usable components/functions where we can call from various output types

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

2 participants