-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
controller_util_test.go does not follow similar patterns as other unit tests in the repo. #119133
Comments
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/test-infra repository. |
/sig apps |
@kannon92: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In 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/test-infra repository. |
I'd like to work on it 😊 /assign |
I'd also like to make some contributions. |
Looks like this need two PRs.
I think I can work on the 2nd one and leave the 1st one to you. Sounds good? |
By looking through the gc_controller_test.go, I found the main function to comapre the results have already used cmp.Diff. Can you elaborate more on which part you expect to use cmp.Diff? func verifyDeletedAndPatchedPods(t *testing.T, client *fake.Clientset, wantDeletedPodNames, wantPatchedPodNames sets.String) { |
I am really sorry about this. Too much multitasking!! I meant https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/controller_utils_test.go not gc_controller_test.go. |
Hey @xuexu6666 ! Sorry, I didn't see this before. No problem at all, but consider that one change depends on the other, and since my task implies a big refactor, there might be conflicts when merging your PR... That's why I see two possible scenarios happening:
Getting a PR merged in the Kubernetes project takes quite some time (trust me, I talk by experience and @kannon92 can confirm 😆 ) WDYT? |
@kaisoz Let's see how it goes. We can always rebase the code change to adapt new. |
@kaisoz btw, did you already begin to work on task 1? If not, I may just go ahead and work on it right away since I have already dig into it. |
@xuexu6666 yes, I already started 😊 And If you ask me, better to keep it this way so we both have an opportunity to have a contribution |
@kaisoz cool. Sounds good. |
/reopen |
@kannon92: Reopened this issue. In 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/test-infra repository. |
Hi @kannon92, if this issue needs to be worked on any further, please assign me for the same. |
@kaisoz has a PR up that will solve the second part of this issue. |
What would you like to be added?
During implementation of KEP 3393 (PodReplacementPolicy for Jobs) we found that the unit tests of controller_util_test.go do not follow common patterns established in k/k.
The tests are not written using table driven design (https://dave.cheney.net/2019/05/07/prefer-table-driven-tests).
The tests use
Differences
rather thanCmp.Diff
.This probably should be done as two separate PRs but wanted to highlight some areas that could use some cleanup.
Why is this needed?
#117015 (comment)
Not using
Cmp.Diff
means that we don't see diffs in the unit tests that makes this difficult.And not using table driven tests makes it difficult to add new test cases as it usually is brought up during review that we should use a table-driven test but the entire file does not obey this format.
The text was updated successfully, but these errors were encountered: