Skip to main content

Policy Testing

These projects from the OPA ecosystem help with or support running of tests on Rego code.

Styra Declarative Authorization Service

Styra Declarative Authorization Service

DAS supports the running of tests alongside Rego policy in its UI. Read documentation about testing Rego policies in DAS.

View Details
Regal

Regal

Regal is a useful step to use when testing Rego policies to ensure code is correct and free of common errors. See the README to get started.

View Details
Conftest

Conftest

Conftest supports unit testing of policy and has a number of extra language features for working with configuration files. The functionality is documented here.

View Details
Styra Enterprise OPA

Styra Enterprise OPA

Enterprise OPA's Live Impact Analysis (LIA) feature allows you to test changes to Rego policy on running instances.

View Details
raygun

raygun

Raygun makes it easier to test Rego code in a "real-world" facsimile.

View Details
GitHub Action for OPA Rego Test

GitHub Action for OPA Rego Test

GitHub Action for OPA Rego Policy Tests automates testing for your OPA (Open Policy Agent) Rego policies, generates a report with coverage information, and posts the test results as a comment on your pull requests, making it easy for your team to review and approve policies.

View Details
rego-test-assertions

rego-test-assertions

The rego-test-assertions library contains various assertion functions, which will print the expected result vs. the outcome to the console on failure.

View Details