Rego test coverage gaps
rego_coverage_gapsRun opa test coverage to find uncovered Rego rules and branches, returning a per-file report sorted by coverage ascending, with an optional threshold to highlight files below a target percentage.
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. |