Add test case in apis/scheduling/v1/helpers.go to improve the test coverage

This commit is contained in:
Kobayashi Daisuke 2020-06-04 17:43:11 +09:00
parent ca7a906ab7
commit 7026cbc1d4

View File

@ -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 {