Skip to content

Commit 7026cbc

Browse files
committed
Add test case in apis/scheduling/v1/helpers.go to improve the test coverage
1 parent ca7a906 commit 7026cbc

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pkg/apis/scheduling/v1/helpers_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,29 @@ func TestIsKnownSystemPriorityClass(t *testing.T) {
4646
},
4747
expected: false,
4848
},
49+
{
50+
name: "not a known system priority class",
51+
pc: &v1.PriorityClass{
52+
ObjectMeta: metav1.ObjectMeta{
53+
Name: "unknown",
54+
},
55+
Value: scheduling.SystemCriticalPriority,
56+
Description: "Used for system critical pods that must run in the cluster, but can be moved to another node if necessary.",
57+
},
58+
expected: false,
59+
},
60+
{
61+
name: "global default changed",
62+
pc: &v1.PriorityClass{
63+
ObjectMeta: metav1.ObjectMeta{
64+
Name: scheduling.SystemClusterCritical,
65+
},
66+
GlobalDefault: true,
67+
Value: scheduling.SystemCriticalPriority,
68+
Description: "Used for system critical pods that must run in the cluster, but can be moved to another node if necessary.",
69+
},
70+
expected: false,
71+
},
4972
}
5073

5174
for _, test := range tests {

0 commit comments

Comments
 (0)