Kubernetes: Improve unit tests of generic_scheduler

Created on 21 Jul 2018  ·  1Comment  ·  Source: kubernetes/kubernetes

Is this a BUG REPORT or FEATURE REQUEST?: clean-up

Uncomment only one, leave it on its own line:

/kind bug
/kind feature

Unit tests of generic_scheduler.go includes a hack that should be removed. We should add a parameter to the test cases that indicates the expected score and then check if the returned value of the functions matches this expected value.

Below is the hack that we should clean up.

if test.test == "test priority of larger pod with machine with zero-request pod" {
    if hp.Score == expectedPriority {
        t.Errorf("%s: expected non-%d for all priorities, got list %#v", test.test, expectedPriority, list)
    }
}

/sig scheduling

help wanted kincleanup sischeduling

Most helpful comment

I'll work on this.
/assign

>All comments

I'll work on this.
/assign

Was this page helpful?
0 / 5 - 0 ratings