From 5013187aaffc1e6efa8f827dc0e1b9bbcdd8831c Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Mon, 24 Oct 2022 17:03:59 +0200 Subject: [PATCH] Add some sort stability Signed-off-by: Kristoffer Dalby --- integration/cli_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/integration/cli_test.go b/integration/cli_test.go index b0d9906f..fb4f5b68 100644 --- a/integration/cli_test.go +++ b/integration/cli_test.go @@ -2,6 +2,7 @@ package integration import ( "encoding/json" + "sort" "testing" "time" @@ -51,10 +52,13 @@ func TestNamespaceCommand(t *testing.T) { ) assert.NoError(t, err) + result := []string{listNamespaces[0].Name, listNamespaces[1].Name} + sort.Strings(result) + assert.Equal( t, []string{"namespace1", "namespace2"}, - []string{listNamespaces[0].Name, listNamespaces[1].Name}, + result, ) _, err = scenario.Headscale().Execute( @@ -83,10 +87,13 @@ func TestNamespaceCommand(t *testing.T) { ) assert.NoError(t, err) + result = []string{listAfterRenameNamespaces[0].Name, listAfterRenameNamespaces[1].Name} + sort.Strings(result) + assert.Equal( t, []string{"namespace1", "newname"}, - []string{listAfterRenameNamespaces[0].Name, listAfterRenameNamespaces[1].Name}, + result, ) err = scenario.Shutdown()