Skip to content

Commit

Permalink
test: ensure slice ordering doesn't matter in test asserts
Browse files Browse the repository at this point in the history
Signed-off-by: Bradley Jones <[email protected]>
  • Loading branch information
bradleyjones committed Apr 3, 2024
1 parent 3b64587 commit 34cc2dd
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 34cc2dd

Please sign in to comment.