Skip to content

Conversation

@GautamBytes
Copy link
Contributor

This pull request introduces comprehensive unit tests for the KindVisitor utility in pkg/internal/apps/kind_visitor.go.

Changes:

TestGroupKindElement_Accept: A table-driven test has been added to ensure the Accept method correctly dispatches to the appropriate Visit function based on the resource's Group and Kind. It uses a mock KindVisitor to validate behavior and covers all existing resource types, including standard Kubernetes and Kruise-specific kinds. It also verifies that an error is correctly returned for unsupported kinds.

TestGroupKindElement_GroupMatch: A table-driven test has been added to validate the GroupMatch helper function, covering various scenarios such as single, multiple, and non-matching groups.

Signed-off-by: GautamBytes <[email protected]>
@kruise-bot kruise-bot requested review from FillZpp and furykerry July 12, 2025 10:52
@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hantmac for approval by writing /assign @hantmac in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants