projectcontour / integration-tester

Integration Tester for Kubernetes
Other
3 stars 5 forks source link

Add explicit `check` results. #21

Closed jpeach closed 3 years ago

jpeach commented 3 years ago

The problem with using the name of the rule to classify the result is that it becomes hard to write generally useful checks. For example, if we need a HTTP response to have a 404 status, we can test for the status in a policy module, but we still need to wrap that in an error rule to propagate the result, which makes tests more verbose than they ought to be.

This change introduces the check rule type, where the result of a rule can be a map with an explicit result field. This allows test authors to write policy modules that are completely self-contained and can return results independently of the rule type. For example, it would be possible to have a single policy function that skips a test if cert-manager is not installed.

Signed-off-by: James Peach jpeach@vmware.com