-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
make coverage threshold show lines missing coverage #2562
Comments
This would be a nice enhancement and is a good area for contribution. At a high-level, I'd expect we would want to:
I'm not too worried about the # of missing lines since I would expect most policies to be completely covered (and in my experience this is often the case.) |
Hey @tsandall, Can I take this up if it is available? Also, does the following output format work?
|
|
With the --threshold flag set, opa did not report the missing lines, making it difficult to understand where the problem is. This commit modifies opa test so that the pretty format reports text instead of JSON, and shows the lines not covered if the threshold is not met. Fixes open-policy-agent#2562 Signed-off-by: Aditya <aditya10699@gmail.com>
when `--verbose` flag is enabled. Fixes: open-policy-agent#2562 Signed-off-by: Johan Fylling <johan.dev@fylling.se>
) Printing lines not covered when test coverage threshold isn't met for `opa test --threshold`, and `--verbose` flag is enabled. Fixes: #2562 Signed-off-by: Johan Fylling <johan.dev@fylling.se>
thx, that looks perfect! |
Running with
--threshold
can fail and then shows "expected 100% got 98%", which then means I have to get out the coverage data and figure out where the problem is.Ideally it would show
missing coverage:\nfoo.rego:12
this could be overwhelming when lots of things are uncovered, so it should be opt in or only show the first N lines with missing coverage.
/cc contributors from threshold #1029 @EliuX @tsandall @flavio @srenatus
The text was updated successfully, but these errors were encountered: