Rego test coverage gaps
rego_coverage_gapsIdentify uncovered line ranges in Rego policy tests. Returns per-file coverage gaps sorted ascending, with optional threshold to focus on poorly covered files.
Instructions
Run opa test --coverage and return a per-file breakdown of uncovered line ranges. Identifies which rules or branches are not yet exercised by tests. Files are sorted by coverage ascending so the worst-covered files appear first. Use threshold to limit the report to files below a target coverage percentage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Test directories or files. opa test looks for *_test.rego siblings of source files. | |
| threshold | No | Report only files below this coverage percentage (0-100). When omitted, all files with uncovered ranges are reported. | |
| runPattern | No | Run only tests whose names match this regex. |