Add unit tests for DPC nodeData scheduling primitives - #665
Conversation
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
|
(1) This is a bunch of checksum tests --- tests of an individual function. It is better to test the behavior at the interface of the package. (2) This is a large collection of very specific scenarios, but even more could be imagined. I think that it would be more maintainable to have one randomized test. Or axiomitize the subject under test and have a test per axiom, with many randomly generated settings for what the axiom ∀-quantifies over. (3) I do not know a way to write behavioral unit tests of Kubernetes controllers, because the generated fake clientsets do not properly implement object update. The simplest sort of test that I know how to write is an integration test, which makes a test-local apiserver and uses that for the test. There are examples of such things. (4) See the unit tests for the launcher population controller for how to exercise more precise and repeatable control over time. See https://github.com/kubernetes/apiserver/blob/v0.34.9/pkg/util/flowcontrol/fairqueuing/queueset/queueset_test.go if you want to go further. |
|
PR #687 will hopefully provide this coverage data and more. |
|
This PR is marked as stale after 21d of inactivity. After an additional 14d of inactivity (7d to become rotten, then 7d more), it will be closed. To prevent this PR from being closed, add a comment or remove the |
Added unit tests for #626.
Before:
After: