mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:17:35 +00:00
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:
41
internal/integration/name.go
Normal file
41
internal/integration/name.go
Normal 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()
|
||||
}
|
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
rand.NewSource(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
|
||||
|
Reference in New Issue
Block a user