Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 412941a

Browse files
committed
Update test sort slices before comparison to disregard order of environment variables
1 parent 0d330ea commit 412941a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

internals/secrethub/run_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"log"
77
"os"
88
"path/filepath"
9+
"sort"
910
"strings"
1011
"testing"
1112

@@ -921,6 +922,12 @@ func TestRunCommand_environment(t *testing.T) {
921922
for name, tc := range cases {
922923
t.Run(name, func(t *testing.T) {
923924
env, secrets, err := tc.command.sourceEnvironment()
925+
926+
sort.Strings(env)
927+
sort.Strings(tc.expectedEnv)
928+
sort.Strings(secrets)
929+
sort.Strings(tc.expectedSecrets)
930+
924931
assert.Equal(t, env, tc.expectedEnv)
925932
assert.Equal(t, secrets, tc.expectedSecrets)
926933
assert.Equal(t, err, tc.err)

0 commit comments

Comments
 (0)