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
parent 5df28465a4
commit 6d0f9087d3
31 changed files with 700 additions and 665 deletions

View File

@@ -0,0 +1,41 @@
package integration
import "github.com/brianvoe/gofakeit/v6"
// company private function to add a random string to the gofakeit.Company function
func company() string {
return gofakeit.Company() + "-" + RandString(5)
}
func OrganizationName() string {
return company()
}
// appName private function to add a random string to the gofakeit.AppName function
func appName() string {
return gofakeit.AppName() + "-" + RandString(5)
}
func TargetName() string {
return appName()
}
func ApplicationName() string {
return appName()
}
func ProjectName() string {
return appName()
}
func IDPName() string {
return appName()
}
func RoleKey() string {
return appName()
}
func RoleDisplayName() string {
return appName()
}

View File

@@ -6,7 +6,7 @@ import (
)
func init() {
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
}
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")