kubernetes: controller_util_test.go does not follow similar patterns as other unit tests in the repo.
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
Differencesrather 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?
https://github.com/kubernetes/kubernetes/pull/117015#discussion_r1254470573
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.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (16 by maintainers)
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.
I’d like to work on it 😊
/assign