-
Notifications
You must be signed in to change notification settings - Fork 52
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: add pod controller unit test #490
test: add pod controller unit test #490
Conversation
Hi @googs1025. 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 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/test-infra repository. |
✅ Deploy Preview for kubernetes-sigs-jobset canceled.
|
/ok-to-test |
f7ff96a
to
0760e9e
Compare
@danielvegamyhre /PTAL thank a lot! |
0760e9e
to
2188080
Compare
6590dd1
to
8c470ad
Compare
@danielvegamyhre /PTAL I have made the necessary modifications. Please take the time to review them. thanks a lot. |
Been busy lately but will review this as soon as I can |
8c470ad
to
7fb078f
Compare
043d929
to
2598008
Compare
2598008
to
cc22f12
Compare
followerPodWrapper.Obj(), | ||
}, | ||
wantPodsDeleted: []corev1.Pod{ | ||
wantPodWrapper.ResourceVersion("999").SetConditions([]corev1.PodCondition{{ |
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.
Can you remind me why we need to explicitly set the resourceVersion here?
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.
https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/client/fake/client.go#L285
I guess the reason for using a magic number here
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.
I see, honestly I think we should just count the number of pod deletion calls made via the Delete() interceptor func. Needing to dive into the weeds of another code base to understand the unit tests isn't worth it for the marginal improvement of the precision of our tests.
Sorry this came up rather late in the review process, I hope you don't mind making the change.
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.
No problem, it's also a learning experience for me, haha. I'll make the change later.
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.
already fixed @danielvegamyhre
839ec0c
to
717d86d
Compare
717d86d
to
56ae233
Compare
/lgtm Thanks @googs1025 for improving our test coverage! This was a much needed improvement. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danielvegamyhre, googs1025 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 |
Finally merged! Haha, thank you for the review. It did take some time, but I also learned a lot from it. @danielvegamyhre |
Added unit test for podcontroller
issue from #478