Skip to content

Commit

Permalink
fix: flaky authconfig conversion tests due to random orderring of ele…
Browse files Browse the repository at this point in the history
…ments within array
  • Loading branch information
guicassolato committed Oct 16, 2023
1 parent b81a6d2 commit 57e0570
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/v1beta2/auth_config_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ func TestConvertTo(t *testing.T) {
sort.Slice(converted.Spec.Callbacks, func(i, j int) bool {
return converted.Spec.Callbacks[i].Name < converted.Spec.Callbacks[j].Name
})
sort.Slice(converted.Spec.DenyWith.Unauthenticated.Headers, func(i, j int) bool {
return converted.Spec.DenyWith.Unauthenticated.Headers[i].Name < converted.Spec.DenyWith.Unauthenticated.Headers[j].Name
})
sort.Slice(converted.Spec.DenyWith.Unauthorized.Headers, func(i, j int) bool {
return converted.Spec.DenyWith.Unauthorized.Headers[i].Name < converted.Spec.DenyWith.Unauthorized.Headers[j].Name
})

expected := hubAuthConfig()
if !reflect.DeepEqual(expected, converted) {
Expand Down

0 comments on commit 57e0570

Please sign in to comment.