open-policy-agent/opa

Support raising builtin errors for test runner

Closed this issue · 0 comments

What is the underlying problem you're trying to solve?

Obtain more helpful insights when builtins running in unit tests encounter errors, rather than just knowing that the unit test failed which currently silently hides these errors.

Describe the ideal solution

Users of the tester package are able to opt-in to having builtin errors raised when encountered.

Describe a "Good Enough" solution

N/A

Additional Context

In conftest, we have custom parse_config* builtins that assist with unit testing. By their nature, typos happen often in the configurations being unit tested, and these result in unit tests failing but the parsing errors are not raised. It would be nice to let users see these errors when encountered so they don't assume it is a problem with their policy logic.