From 8dadc16a27c593481f16bbf5269b2928d10db132 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Apr 2019 11:13:33 +0800 Subject: [PATCH] fix action UT --- pkg/scheduler/actions/allocate/allocate_test.go | 9 +++++++++ pkg/scheduler/actions/preempt/preempt_test.go | 9 +++++++++ pkg/scheduler/actions/reclaim/reclaim_test.go | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/pkg/scheduler/actions/allocate/allocate_test.go b/pkg/scheduler/actions/allocate/allocate_test.go index 6a2fd53740..777465956c 100644 --- a/pkg/scheduler/actions/allocate/allocate_test.go +++ b/pkg/scheduler/actions/allocate/allocate_test.go @@ -59,6 +59,9 @@ func TestAllocate(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "c1", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, }, pods: []*v1.Pod{ @@ -94,6 +97,9 @@ func TestAllocate(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "c1", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -103,6 +109,9 @@ func TestAllocate(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "c2", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, }, diff --git a/pkg/scheduler/actions/preempt/preempt_test.go b/pkg/scheduler/actions/preempt/preempt_test.go index ed61bc1c3a..d7a5fa3e92 100644 --- a/pkg/scheduler/actions/preempt/preempt_test.go +++ b/pkg/scheduler/actions/preempt/preempt_test.go @@ -58,6 +58,9 @@ func TestPreempt(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "q1", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, }, pods: []*v1.Pod{ @@ -92,6 +95,9 @@ func TestPreempt(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "q1", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -101,6 +107,9 @@ func TestPreempt(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "q1", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, }, diff --git a/pkg/scheduler/actions/reclaim/reclaim_test.go b/pkg/scheduler/actions/reclaim/reclaim_test.go index bd5e758d47..ace0f90c82 100644 --- a/pkg/scheduler/actions/reclaim/reclaim_test.go +++ b/pkg/scheduler/actions/reclaim/reclaim_test.go @@ -58,6 +58,9 @@ func TestReclaim(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "q1", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -67,6 +70,9 @@ func TestReclaim(t *testing.T) { Spec: kbv1.PodGroupSpec{ Queue: "q2", }, + Status: kbv1.PodGroupStatus{ + Phase: kbv1.PodGroupInqueue, + }, }, }, pods: []*v1.Pod{