From 7026cbc1d493fc4f26c9efac7b0d1d27c2e4bfc7 Mon Sep 17 00:00:00 2001 From: Kobayashi Daisuke Date: Thu, 4 Jun 2020 17:43:11 +0900 Subject: [PATCH] Add test case in apis/scheduling/v1/helpers.go to improve the test coverage --- pkg/apis/scheduling/v1/helpers_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkg/apis/scheduling/v1/helpers_test.go b/pkg/apis/scheduling/v1/helpers_test.go index 25bec784ac6..010a9a79182 100644 --- a/pkg/apis/scheduling/v1/helpers_test.go +++ b/pkg/apis/scheduling/v1/helpers_test.go @@ -46,6 +46,29 @@ func TestIsKnownSystemPriorityClass(t *testing.T) { }, expected: false, }, + { + name: "not a known system priority class", + pc: &v1.PriorityClass{ + ObjectMeta: metav1.ObjectMeta{ + Name: "unknown", + }, + Value: scheduling.SystemCriticalPriority, + Description: "Used for system critical pods that must run in the cluster, but can be moved to another node if necessary.", + }, + expected: false, + }, + { + name: "global default changed", + pc: &v1.PriorityClass{ + ObjectMeta: metav1.ObjectMeta{ + Name: scheduling.SystemClusterCritical, + }, + GlobalDefault: true, + Value: scheduling.SystemCriticalPriority, + Description: "Used for system critical pods that must run in the cluster, but can be moved to another node if necessary.", + }, + expected: false, + }, } for _, test := range tests {