Skip to content

Add unit tests for rollout_utils#145

Open
GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
GautamBytes:add-rollout-utils-tests
Open

Add unit tests for rollout_utils#145
GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
GautamBytes:add-rollout-utils-tests

Conversation

@GautamBytes
Copy link
Copy Markdown
Contributor

What this PR does / why we need it

This PR adds a full unit test suite for rollout_utils.go to cover its critical helper functions. These functions, which handle pod filtering and partition calculations for CloneSet rollouts, previously had no test coverage, posing a risk for regressions.

The new tests use a mock Kubernetes client to ensure all logic can be verified reliably in an isolated environment. This improves the overall stability and code quality of the package.

How to test this PR

This PR consists of a new test file. The changes can be verified by running the test suite for the package and confirming that it passes:

go test ./pkg/internal/polymorphichelpers

Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
@kruise-bot kruise-bot requested review from furykerry and hantmac July 11, 2025 18:54
@kruise-bot
Copy link
Copy Markdown

[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 furykerry for approval by writing /assign @furykerry 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.

Details 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