chore: fix flakiness in gofakeit usage with additional random string (#10385)

# Which Problems Are Solved

Flakiness in integration tests regarding gofakeit functions, which
provided the same names on 2 different occasions.

# How the Problems Are Solved

Attach a random string to the provided names, so that they are not
dependent on the gofakeit code.

# Additional Changes

None

# Additional Context

None

---------

Co-authored-by: Marco A. <marco@zitadel.com>
This commit is contained in:
Stefan Benz
2025-08-07 15:27:01 +02:00
committed by GitHub
parent a96f4708cb
commit 6e8aa9a7d1
31 changed files with 700 additions and 665 deletions

View File

@@ -4,7 +4,6 @@ package user_test
import (
"context"
"fmt"
"testing"
"time"
@@ -12,6 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/zitadel/zitadel/internal/integration"
"github.com/zitadel/zitadel/pkg/grpc/user/v2"
)
@@ -97,7 +97,7 @@ func TestServer_AddSecret(t *testing.T) {
}
func TestServer_AddSecret_Permission(t *testing.T) {
otherOrg := Instance.CreateOrganization(IamCTX, fmt.Sprintf("AddSecret-%s", gofakeit.AppName()), gofakeit.Email())
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
otherOrgUser, err := Instance.Client.UserV2.CreateUser(IamCTX, &user.CreateUserRequest{
OrganizationId: otherOrg.OrganizationId,
UserType: &user.CreateUserRequest_Machine_{
@@ -244,7 +244,7 @@ func TestServer_RemoveSecret(t *testing.T) {
}
func TestServer_RemoveSecret_Permission(t *testing.T) {
otherOrg := Instance.CreateOrganization(IamCTX, fmt.Sprintf("RemoveSecret-%s", gofakeit.AppName()), gofakeit.Email())
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
otherOrgUser, err := Instance.Client.UserV2.CreateUser(IamCTX, &user.CreateUserRequest{
OrganizationId: otherOrg.OrganizationId,
UserType: &user.CreateUserRequest_Machine_{