mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 03:38:15 +00:00
cleanup: move scheduler plugin tests to use PodWrapper
Move scheduler plugin unit tests use testing PodWrapper where applicable to reduce duplicating pod creation code and shorten number of lines. Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
This commit is contained in:
@@ -80,7 +80,7 @@ func TestMostAllocatedScoringStrategy(t *testing.T) {
|
||||
// CPU Score: (3000 * MaxNodeScore) / 6000 = 50
|
||||
// Memory Score: (5000 * MaxNodeScore) / 10000 = 50
|
||||
// Node2 Score: (50 + 50) / 2 = 50
|
||||
name: "nothing scheduled, resources requested, differently sized machines",
|
||||
name: "nothing scheduled, resources requested, differently sized nodes",
|
||||
requestedPod: st.MakePod().
|
||||
Req(map[v1.ResourceName]string{"cpu": "1000", "memory": "2000"}).
|
||||
Req(map[v1.ResourceName]string{"cpu": "2000", "memory": "3000"}).
|
||||
@@ -94,7 +94,7 @@ func TestMostAllocatedScoringStrategy(t *testing.T) {
|
||||
resources: defaultResources,
|
||||
},
|
||||
{
|
||||
name: "Resources not set, nothing scheduled, resources requested, differently sized machines",
|
||||
name: "Resources not set, nothing scheduled, resources requested, differently sized nodes",
|
||||
requestedPod: st.MakePod().
|
||||
Req(map[v1.ResourceName]string{"cpu": "1000", "memory": "2000"}).
|
||||
Req(map[v1.ResourceName]string{"cpu": "2000", "memory": "3000"}).
|
||||
@@ -185,7 +185,7 @@ func TestMostAllocatedScoringStrategy(t *testing.T) {
|
||||
// CPU Score: (3000 *100) / 6000 = 50
|
||||
// Memory Score: (5000 *100) / 10000 = 50
|
||||
// Node2 Score: (50 * 1 + 50 * 2) / (1 + 2) = 50
|
||||
name: "nothing scheduled, resources requested, differently sized machines",
|
||||
name: "nothing scheduled, resources requested, differently sized nodes",
|
||||
requestedPod: st.MakePod().
|
||||
Req(map[v1.ResourceName]string{"cpu": "1000", "memory": "2000"}).
|
||||
Req(map[v1.ResourceName]string{"cpu": "2000", "memory": "3000"}).
|
||||
|
||||
Reference in New Issue
Block a user