Skip to content

Commit

Permalink
sorted the result of GetDosProtectedThatReferencedDosLogConf in unit …
Browse files Browse the repository at this point in the history
…test to make it deterministic
  • Loading branch information
ciarams87 committed Dec 20, 2021
1 parent 6dddcb2 commit 99b7126
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,9 @@ func TestGetDosProtectedThatReferencedDosLogConf(t *testing.T) {
for _, test := range tests {
resources := dosConf.GetDosProtectedThatReferencedDosLogConf(test.policyNamespace + "/" + test.policyName)
if diff := cmp.Diff(test.expected, resources); diff != "" {
sort.SliceStable(resources, func(i, j int) bool {
return resources[i].Name < resources[j].Name
})
t.Errorf("GetDosProtectedThatReferencedDosLogConf() returned unexpected result for the case of: %v (-want +got):\n%s", test.msg, diff)
}
}
Expand Down

0 comments on commit 99b7126

Please sign in to comment.