Merge branch 'fix-flaky-test' into 'main'

fix: flaky test

See merge request unboundsoftware/gitlab-cleanup-handler!7
This commit was merged in pull request #11.
This commit is contained in:
2022-09-30 20:58:32 +00:00
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -2,3 +2,7 @@ vendor
.gitignore
.git
Dockerfile
coverage.txt
coverage.html
/exported
/release
+7
View File
@@ -3,6 +3,7 @@ package kube
import (
"context"
"fmt"
"sort"
"testing"
"github.com/stretchr/testify/assert"
@@ -269,6 +270,12 @@ func TestClient_GetImages(t *testing.T) {
if !tt.wantErr(t, err, fmt.Sprintf("GetImages(%v, %v, %v)", ctx, logger, tt.args.namespaces)) {
return
}
for k, v := range got {
sort.SliceStable(v, func(i, j int) bool {
return v[i] < v[j]
})
got[k] = v
}
assert.Equalf(t, tt.want, got, "GetImages(%v, %v, %v)", ctx, logger, tt.args.namespaces)
logger.Check(t, tt.wantLogged)
})