Skip to content

Commit

Permalink
Updating tests to reflect updated client-go list ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
robscott committed Dec 30, 2020
1 parent c19e016 commit ad73636
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions pkg/capacity/capacity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,33 @@ func TestGetPodsAndNodes(t *testing.T) {
podList, nodeList := getPodsAndNodes(clientset, "", "", "")
assert.Equal(t, []string{"mynode", "mynode2"}, listNodes(nodeList))
assert.Equal(t, []string{
"default/mypod", "kube-system/mypod1", "other/mypod2", "other/mypod3", "default/mypod4",
"another/mypod5", "default/mypod6",
"another/mypod5",
"default/mypod",
"default/mypod4",
"default/mypod6",
"kube-system/mypod1",
"other/mypod2",
"other/mypod3",
}, listPods(podList))

podList, nodeList = getPodsAndNodes(clientset, "", "hello=world", "")
assert.Equal(t, []string{"mynode", "mynode2"}, listNodes(nodeList))
assert.Equal(t, []string{
"default/mypod", "kube-system/mypod1", "other/mypod2", "other/mypod3", "default/mypod4",
"another/mypod5", "default/mypod6",
"another/mypod5",
"default/mypod",
"default/mypod4",
"default/mypod6",
"kube-system/mypod1",
"other/mypod2",
"other/mypod3",
}, listPods(podList))

podList, nodeList = getPodsAndNodes(clientset, "", "moon=lol", "")
assert.Equal(t, []string{"mynode2"}, listNodes(nodeList))
assert.Equal(t, []string{
"kube-system/mypod1", "other/mypod3", "default/mypod4",
"default/mypod4",
"kube-system/mypod1",
"other/mypod3",
}, listPods(podList))

podList, nodeList = getPodsAndNodes(clientset, "a=test", "", "")
Expand Down

0 comments on commit ad73636

Please sign in to comment.