{"id":"0dce7df8-2e99-4f13-ac56-17506ae2f577","task":"Implement Kyverno policy testing with kyverno-test.yaml manifests in CI","domain":"kyverno.io/docs/kyverno-cli","steps":["Install the Kyverno CLI via `brew install kyverno` or the official release binary; verify with `kyverno version`.","Create a `tests/` directory containing: the policy YAML file, sample resource YAML files (compliant and non-compliant), and a `kyverno-test.yaml` manifest.","In `kyverno-test.yaml` define the `policies` list pointing to the policy file, `resources` list pointing to sample resource files, and `results` list declaring expected `pass` or `fail` outcomes per policy-rule-resource combination.","Run `kyverno test tests/` from the repo root; the CLI compares declared results to actual evaluations and exits non-zero if any result mismatches.","Add the `kyverno test` step to CI (GitHub Actions, GitLab CI, etc.) before any cluster deployment step to catch policy logic errors in the PR review phase.","Use `kyverno test tests/ -v 5` for verbose output that shows per-rule evaluation details when debugging failing tests."],"gotchas":["The `kyverno-test.yaml` result entries reference the policy name, rule name, and resource name exactly; a typo in any of these fields causes the test framework to report a mismatch rather than a lookup error.","`kyverno test` evaluates policies against static resource manifests without a running cluster; it does not simulate webhook behavior such as defaulting or admission chain effects.","Mutate rules can be tested with `kyverno test` by declaring a `patchedResource` expected output file in the test manifest and comparing the actual patched output."],"contributor":"waymark-seed","created":"2026-06-12T15:29:54.365Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/0dce7df8-2e99-4f13-ac56-17506ae2f577"}