opa icon indicating copy to clipboard operation
opa copied to clipboard

Add test coverage for policies in docs

Open tsandall opened this issue 7 years ago • 1 comments

We have a growing number of tutorials and examples in the docs. While the unit and integration tests in OPA proper should be the primary means of testing, it would be beneficial if we were able to run tests against the policies embedded in OPA documentation.

There are roughly two separate tasks to achieve this:

  1. Review existing docs and write tests for policy examples starting with tutorials.
  2. Implement automation to execute tests against policies embedded in docs.

These tests should be executable during the normal build process.

To facilitate this we should either (a) build tooling that's capable of quickly extracting policies from the Markdown files or (b) move the example policies out into their own standalone files.

tsandall avatar Aug 16 '18 00:08 tsandall

I imagine that doccmd might be relevant for this. We already have tooling for extracting policies from the Markdown files in the live snippets machinery, but I'd rather not build on that.

srenatus avatar Mar 27 '25 08:03 srenatus