Skip to content

Commit

Permalink
Added testing.md to explain how to write a test (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy authored May 21, 2020
1 parent 6a89568 commit fd47b01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit fd47b01

Please sign in to comment.