Repository navigation
test: cover InferencePoolToEndpointPool - #3011
Conversation
The conversion had no test coverage. It is on the reconciler's hot path: every InferencePool reconcile passes its result to Datastore.PoolSet, so a regression here silently changes which pods the datastore selects rather than failing loudly. Adds table-driven cases for the nil input, full selector/port/namespace conversion, target port ordering, and the empty-spec case that yields empty but non-nil Selector and TargetPorts. Package coverage 0% to 100%. Signed-off-by: Kush Zingade <[email protected]>
|
@UgaTheDev: The label(s) DetailsIn response to this:
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. |
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @UgaTheDev. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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: UgaTheDev The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/kind cleanup |
|
/ok-to-test |
What type of PR is this?
/kind test
What this PR does / why we need it:
pkg/lwepp/util/poolhad no test file, leavingInferencePoolToEndpointPoolat 0% coverage.The function sits on the reconciler's hot path.
InferencePoolReconciler.Reconcilepasses its result straight intoDatastore.PoolSet, which is what decides the label selector the datastore uses to pick endpoints. A regression in the conversion does not fail loudly, it silently changes which pods receive inference traffic, so it is worth pinning down.This adds a table-driven test covering:
PoolSettreats a nil pool as aClear()PortNumberint32 to int narrowingSelectorandTargetPorts, which is the current contract and distinguishable from nil at the call sitePackage coverage goes from 0% to 100% of statements.
I checked the test actually fails when the behaviour breaks rather than only passing: dropping the
Namespaceassignment fails the suite, and removing the nil guard panics it.Tests only, no production code touched.
Which issue(s) this PR fixes:
None.
Does this PR introduce a user-facing change?: