-
Notifications
You must be signed in to change notification settings - Fork 40.9k
test: code coverage increase for kubelet_client #132484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: code coverage increase for kubelet_client #132484
Conversation
Hi @ylink-lfs. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/triage accepted |
84aa5e6
to
651eeac
Compare
176c5ee
to
9336f45
Compare
9336f45
to
1f71e67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR significantly increases unit test coverage for the kubelet/client
package by adding helper utilities and covering various transport and node connection code paths.
- Added
kubeletTestCertHelper
andkubeletTestRoundTripHelper
to DRY up certificate setup and request validation. - Expanded tests for
MakeTransport
,MakeInsecureTransport
, and lookup-based dialing. - Introduced tests for
NewNodeConnectionInfoGetter
and itsGetConnectionInfo
method under multiple node scenarios.
Comments suppressed due to low confidence (2)
pkg/kubelet/client/kubelet_client_test.go:94
- Consider adding a functional round-trip check (using httptest.NewTLSServer) in TestMakeTransportValid to verify the transport can successfully perform HTTP requests, improving coverage and catching configuration issues.
if rt == nil {
pkg/kubelet/client/kubelet_client_test.go:99
- The test name suggests it's testing MakeTransport with Lookup, but it actually calls MakeInsecureTransport. Consider renaming the test function to TestMakeInsecureTransportWithLookup or updating it to invoke MakeTransport as intended.
func TestMakeTransportWithLookUp(t *testing.T) {
1f71e67
to
ec6ea22
Compare
/lgtm /assign @SergeyKanzhelev @mrunalp |
LGTM label has been added. Git tree hash: 8f549f7604c4c0da0fb57cf6496390d745b29698
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tallclair, ylink-lfs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
/sig node
What this PR does / why we need it:
Test coverage increase for kubelet package
Which issue(s) this PR is related to:
Part of #109717
Special notes for your reviewer:
Before the commits are made, the coverage of kubelet-client is 28.2%:
This commit increases the coverage to 92.3%:
Does this PR introduce a user-facing change?
None
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
None