Skip to content

Add unit tests for pkg/util/client/cache.go#270

Open
GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
GautamBytes:add-util-client-cache-tests
Open

Add unit tests for pkg/util/client/cache.go#270
GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
GautamBytes:add-util-client-cache-tests

Conversation

@GautamBytes
Copy link
Copy Markdown
Contributor

This PR introduces a new test file, cache_test.go, to provide comprehensive unit test coverage for the custom cache implementation located in pkg/util/client/cache.go.

The new tests cover the following key areas:

Cache Creation: Verifies the NewCache function under various configurations, including default and custom schemes.

List Logic: Tests the branching logic of the internalCache.List method, ensuring it correctly handles the DisableDeepCopy option and the associated disable-no-deepcopy global flag.

Helper Functions: Validates helper utilities like isDisableDeepCopy and the no-op ApplyToList method to ensure complete coverage.

Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
@kruise-bot kruise-bot requested review from FillZpp and furykerry August 3, 2025 17:52
@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 zmberg for approval by writing /assign @zmberg 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

@GautamBytes
Copy link
Copy Markdown
Contributor Author

@ringtail , @chrisliu1995 will you rerun the workflow they seem to be unrelated to my pr , it will pass then. Also , review this whenever feasible!

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