Add test coverage for policies in docs
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:
- Review existing docs and write tests for policy examples starting with tutorials.
- 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.
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.