Skip to content

Commit

Permalink
sort usernames when checking nstemplateset
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrancisc committed Aug 22, 2023
1 parent 88eaeb5 commit 90d10e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/parallel/spacebindingrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package parallel
import (
"context"
"fmt"
"sort"
"testing"

toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1"
Expand Down Expand Up @@ -269,9 +270,11 @@ func NewSpaceBindingRequest(t *testing.T, awaitilities Awaitilities, memberAwait
tier, err := awaitilities.Host().WaitForNSTemplateTier(t, space.Spec.TierName)
require.NoError(t, err)
if spaceRole == "admin" {
usernamesSorted := []string{firstUserSignup.Status.CompliantUsername, secondUserMUR.Name}
sort.Strings(usernamesSorted)
_, err = memberAwait.WaitForNSTmplSet(t, space.Name,
UntilNSTemplateSetHasSpaceRoles(
SpaceRole(tier.Spec.SpaceRoles[spaceRole].TemplateRef, firstUserSignup.Status.CompliantUsername, secondUserMUR.Name)))
SpaceRole(tier.Spec.SpaceRoles[spaceRole].TemplateRef, usernamesSorted[0], usernamesSorted[1])))
require.NoError(t, err)
} else {
_, err = memberAwait.WaitForNSTmplSet(t, space.Name,
Expand Down

0 comments on commit 90d10e3

Please sign in to comment.