Skip to content

Improve PolicyException validation test coverage #104

Description

@karthikmanam

Summary

The current PolicyException validation tests in api/policies.kyverno.io/v1beta1/policy_exception_test.go leave some validation paths untested.

Specifically:

  • TestCELPolicyException_GetKind contains duplicate subtest names (not set).
  • TestCELPolicyExceptionSpec_Validate includes a // TODO: Add test cases. comment.
  • Validation cases for:
    • a policy reference missing both name and kind
    • multiple invalid policy references with indexed field paths

are currently not covered.

Proposed change

  • Rename the duplicate subtest for better test output.
  • Add the missing validation test cases.
  • Remove the existing TODO after adding the coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions