Matrix testing to ensure business coverage of rules #514
Unanswered
marcaurele
asked this question in
OPA and Rego
Replies: 1 comment 1 reply
-
Hi @marcaurele 👋 There isn't currently an "official" way to do parameterized tests, although it's been on my wish list for a long time. See this issue and the discussion there for some possible workarounds. And of course, make sure to upvote it! And add a comment if you have ideas on what you'd want it to look like. An interesting take I saw on this just some week ago was in the CVAT project, where they generate Rego tests from CSV data to cover all combinations (over 30K tests!): https://github.com/opencv/cvat/tree/develop/cvat/apps/iam/rules |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a question on how to best write the test cases for our rules as it tends to grow with way too many repetition today.
Currently we are writing the tests like:
So basically we repeat all the test to cover the matrix of
action
xpath
possibilities. This is to ensure the definition of the rules was correctly defined going over all the possible cases. We are reaching 3000 tests today.Is there a way to create an easy parametrized list of test, like what I can refer to with pytest?
How would be a best approach to write this test matrix covering all the possible cases?
Beta Was this translation helpful? Give feedback.
All reactions