Skip to content

adding unit test for pkg/client/registry.go#272

Open
Prakhar-Shankar wants to merge 1 commit intoopenkruise:masterfrom
Prakhar-Shankar:registry-test
Open

adding unit test for pkg/client/registry.go#272
Prakhar-Shankar wants to merge 1 commit intoopenkruise:masterfrom
Prakhar-Shankar:registry-test

Conversation

@Prakhar-Shankar
Copy link
Copy Markdown
Contributor

Title:

Add unit tests for client/registry.go

Description:

This PR adds unit tests for the pkg/client/registry.go file to improve coverage and ensure the correctness of the NewRegistry, GetGenericClient, and GetGenericClientWithName functions.

Fixes issue #266

Tests include:

Successful client initialization

Retrieval of default client

User-agent customization via GetGenericClientWithName

These tests help validate basic functionality and ensure expected behavior when the registry is used.

Signed-off-by: Prakhar-Shankar <prakharshankar247@gmail.com>
@kruise-bot kruise-bot requested review from FillZpp and furykerry August 4, 2025 18:57
@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 fillzpp for approval by writing /assign @fillzpp 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

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 31.30%. Comparing base (1ca95a5) to head (ab2e3d1).
⚠️ Report is 39 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
+ Coverage   27.65%   31.30%   +3.65%     
==========================================
  Files          94       96       +2     
  Lines       10450    11327     +877     
==========================================
+ Hits         2890     3546     +656     
- Misses       7358     7535     +177     
- Partials      202      246      +44     
Flag Coverage Δ
unittests 31.30% <ø> (+3.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Prakhar-Shankar
Copy link
Copy Markdown
Contributor Author

@chrisliu1995 can you please review this PR, thanks :)

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