From ad73636a09267777fc703c70e9bd87e5daabc644 Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Tue, 29 Dec 2020 21:52:45 -0800 Subject: [PATCH] Updating tests to reflect updated client-go list ordering --- pkg/capacity/capacity_test.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pkg/capacity/capacity_test.go b/pkg/capacity/capacity_test.go index 2fd90a1e..dc522c68 100644 --- a/pkg/capacity/capacity_test.go +++ b/pkg/capacity/capacity_test.go @@ -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", "", "")