test(kubeclient): add cronjob fallback status cases#5773
test(kubeclient): add cronjob fallback status cases#5773r0hansaxena wants to merge 2 commits intofluid-cloudnative:masterfrom
Conversation
Signed-off-by: r0hansaxena <rohansxn8772@gmail.com>
|
[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 |
|
Hi @r0hansaxena. Thanks for your PR. I'm waiting for a fluid-cloudnative 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. 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/test-infra repository. |
There was a problem hiding this comment.
Code Review
This pull request adds unit tests for GetCronJobStatus to verify the fallback mechanism for batchv1beta1 CronJobs when batchv1 is not supported by the cluster. The review feedback suggests improving the test setup by properly handling errors during scheme registration and refactoring the new test cases to eliminate redundant mocking logic through a shared BeforeEach block.
There was a problem hiding this comment.
Code Review
This pull request adds unit tests for GetCronJobStatus to verify the fallback logic when batchv1 CronJobs are not supported and batchv1beta1 is used instead. The feedback suggests improving the test setup by moving the scheme registration to a global initialization block like BeforeSuite to avoid potential race conditions and redundant calls, and recommends checking the error returned by AddToScheme rather than ignoring it.
Signed-off-by: r0hansaxena <rohansxn8772@gmail.com>
|



Ⅰ. Describe what this PR does
test(pkg/utils/kubeclient): add unit tests for GetCronJobStatus fallback path when batch/v1 CronJob is not supported.Ⅱ. Does this pull request fix one issue?
part of #5407
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
GetCronJobStatusreturns converted status frombatch/v1beta1CronJob whenbatch/v1is not supported.GetCronJobStatusreturns error whenbatch/v1is not supported andbatch/v1beta1CronJob is not found.Ⅳ. Describe how to verify it
go test ./pkg/utils/kubeclient -vⅤ. Special notes for reviews