diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7e5baea6..878a37db 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,6 @@ Describe the contents of the PR #### How do we test this? -Provide commands/steps to test this PR. +Have you followed the TESTING.md doc? If not, please provide commands/steps to test this PR. cc: @redhat-cop/day-in-the-life diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 00000000..7fdc51ff --- /dev/null +++ b/TESTING.md @@ -0,0 +1,10 @@ +# testing +This repo uses as a combination of [bats](https://github.com/bats-core/bats-core) and [conftest](https://github.com/open-policy-agent/conftest) +to validate the rego policies. + +## How do i write a test? +Each test is expected to have a directory under [_test](_test) which contains the test input data; typically a yaml file +containing a OCP Template or k8s List. + +The tests are executed by [_test/tests.bats](_test/tests.bats). The test should validate each expected bats output and always +end with the expected success line.