Skip to content

Commit

Permalink
Merge pull request #187 from anchore/test-fix
Browse files Browse the repository at this point in the history
test: ensure slice ordering doesn't matter in test asserts
  • Loading branch information
bradleyjones authored Apr 3, 2024
2 parents 3b64587 + 34cc2dd commit 07f70cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/reporter/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,13 @@ func TestNormalize(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
report, mod := Normalize(tt.args.report)
assert.Equal(t, tt.want, report)
assert.ElementsMatch(t, tt.want.Namespaces, report.Namespaces)
assert.ElementsMatch(t, tt.want.Nodes, report.Nodes)
assert.ElementsMatch(t, tt.want.Pods, report.Pods)
assert.ElementsMatch(t, tt.want.Containers, report.Containers)
assert.Equal(t, tt.want.ClusterName, report.ClusterName)
assert.Equal(t, tt.want.Timestamp, report.Timestamp)
assert.Equal(t, tt.want.ServerVersionMetadata, report.ServerVersionMetadata)
assert.Equal(t, tt.modified, mod)
})
}
Expand Down

0 comments on commit 07f70cb

Please sign in to comment.