Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Commit 63a8977

Browse files
committed
fix migration12 test
1 parent 098e7c3 commit 63a8977

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

migration12/migration12_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package migration12
22

33
import (
4+
"bytes"
45
"encoding/json"
56
"io/ioutil"
67
"os"
8+
"sort"
79
"testing"
810

911
"github.com/stretchr/testify/require"
@@ -48,6 +50,13 @@ func TestMigrate12(t *testing.T) {
4850

4951
oldCredentials, err := mg1b.List(repo1)
5052
require.NoError(t, err)
53+
require.NoError(t, err)
54+
sort.Slice(oldCredentials, func(i, j int) bool {
55+
k := bytes.Compare(oldCredentials[i].Salt(), oldCredentials[j].Salt())
56+
require.NotEqual(t, 0, k)
57+
return k < 0
58+
})
59+
5160
oldJSON, err := json.Marshal(oldCredentials)
5261
require.NoError(t, err)
5362

@@ -59,6 +68,12 @@ func TestMigrate12(t *testing.T) {
5968

6069
newCredentials, err := mg2b.List(repo2)
6170
require.NoError(t, err)
71+
sort.Slice(newCredentials, func(i, j int) bool {
72+
k := bytes.Compare(newCredentials[i].Salt(), newCredentials[j].Salt())
73+
require.NotEqual(t, 0, k)
74+
return k < 0
75+
})
76+
6277
newJSON, err := json.Marshal(newCredentials)
6378
require.NoError(t, err)
6479
require.Equal(t, oldJSON, newJSON)

0 commit comments

Comments
 (0)