-
Notifications
You must be signed in to change notification settings - Fork 40.9k
test: code coverage increase for kubelet/prober #132534
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
base: master
Are you sure you want to change the base?
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ylink-lfs 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 |
/release-note-none |
9f8e697
to
be8f775
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 increases test coverage for the kubelet/prober package by adding new tests and moving some test functions to a more appropriate location. Key changes include:
- Adding new unit tests in pkg/probe/util_test.go for URL and TCP parts parsing.
- Extending the prober tests in pkg/kubelet/prober/prober_test.go with multiple fake prober implementations and additional test cases for various probe schemes.
- Enhancing the prober manager tests in pkg/kubelet/prober/prober_manager_test.go to validate duplicate probe worker handling and proper stopping of liveness/startup probes.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
pkg/probe/util_test.go | Added tests for GetURLParts and GetTCPAddrParts to verify port and URL parsing. |
pkg/kubelet/prober/prober_test.go | Introduced fake prober types and extended probe tests for exec, HTTP, TCP, and GRPC probes. |
pkg/kubelet/prober/prober_manager_test.go | Added tests for duplicate probe worker creation and StopLivenessAndStartup functionality. |
be8f775
to
e0a2bb3
Compare
@bart0sh Would you be willing to review? |
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 were made, the coverage of
pkg/kubelet/prober
module was 80.5%:This commit increased the coverage to 94.1%:
Note that the coverage of
prober.go
file increased from 62.6% to 94.5% because tests for probe method other thanExec-Probe
were added.prober_manager.go
file increased from 81.8% to 94.2% because tests forStopLivenessAndStartup
and duplicate probe addition inAddPod
are added.Also, this commit moved test functions
TestGetURLParts
andTestGetTCPAddrParts
topkg/probe/util_test.go
because those two test functions mainly testResolveContainerPort
, which is not provided bypkg/kubelet/probe
.Does this PR introduce a user-facing change?
None
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
None