feat(test): Add integration tests for status server#3373
feat(test): Add integration tests for status server#3373digvijay-y wants to merge 3 commits intokubeflow:masterfrom
Conversation
Signed-off-by: DIGVIJAY <144053736+digvijay-y@users.noreply.github.com>
Signed-off-by: DIGVIJAY <144053736+digvijay-y@users.noreply.github.com>
|
🎉 Welcome to the Kubeflow Trainer! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
Pull request overview
Adds Ginkgo integration coverage for the status server’s handleTrainJobRuntimeStatus endpoint, exercising real API-server validation behavior in the envtest-based integration suite.
Changes:
- Introduces a new integration spec that boots a TLS-enabled status server and posts status updates against it.
- Covers success, invalid payload validation (e.g., progressPercentage > 100), and not-found TrainJob updates.
| httpClient = &http.Client{ | ||
| Transport: &http.Transport{ | ||
| TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, //nolint:gosec // test only | ||
| }, | ||
| } |
There was a problem hiding this comment.
The http.Client here has no per-request timeout, and the custom http.Transport will use the default ~30s dial timeout, so a stalled connect can block longer than the Eventually window and slow/hang the suite; set httpClient.Timeout (and/or transport dial/handshake timeouts) to a small value for tests.
| go func() { | ||
| defer ginkgo.GinkgoRecover() | ||
| _ = server.Start(serverCtx) | ||
| }() |
There was a problem hiding this comment.
The goroutine running server.Start ignores its returned error, which can turn bind/TLS failures into a later timeout with no useful signal; capture the error via a channel (and fail the spec immediately) so startup issues are surfaced deterministically.
Signed-off-by: DIGVIJAY <144053736+digvijay-y@users.noreply.github.com>
What this PR does / why we need it:
Adds integration tests for the status server handleTrainJobRuntimeStatus handler.
The tests include coverage of:
progressPercentage greater than 100+kubebuilder:validation:Minimum=0and+kubebuilder:validation:Maximum=100with this handler would return 422Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...format, will close the issue(s) when PR gets merged):Fixes #3346
Checklist: