Skip to content

Commit

Permalink
Merge c6ba091 into 28f1564
Browse files Browse the repository at this point in the history
  • Loading branch information
capella committed Sep 2, 2019
2 parents 28f1564 + c6ba091 commit b99f951
Show file tree
Hide file tree
Showing 3 changed files with 235,903 additions and 4 deletions.
4 changes: 2 additions & 2 deletions loadtest/clan.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (app *App) getCreateClanOperation() operation {
clanPublicID := getRandomPublicID()
createdPublicID, err := app.client.CreateClan(nil, &lib.ClanPayload{
PublicID: clanPublicID,
Name: getRandomClanName(),
Name: getRandomClanName(10),
OwnerPublicID: playerPublicID,
Metadata: getMetadataWithRandomScore(),
AllowApplication: true,
Expand Down Expand Up @@ -236,7 +236,7 @@ func (app *App) getSearchClansOperation() operation {
return true, nil
},
execute: func() error {
searchClansResult, err := app.client.SearchClans(nil, getRandomClanName())
searchClansResult, err := app.client.SearchClans(nil, getRandomClanName(10))
if err != nil {
return err
}
Expand Down
9 changes: 7 additions & 2 deletions loadtest/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package loadtest
import (
"fmt"
"math/rand"
"strings"

uuid "github.com/satori/go.uuid"
)
Expand All @@ -15,8 +16,12 @@ func getRandomPlayerName() string {
return fmt.Sprintf("PlayerName-%s", uuid.NewV4().String()[:8])
}

func getRandomClanName() string {
return fmt.Sprintf("ClanName-%s", uuid.NewV4().String()[:8])
func getRandomClanName(numberOfWords int) string {
pieces := []string{}
for i := 0; i < numberOfWords; i++ {
pieces = append(pieces, dictionary[rand.Int()%len(dictionary)])
}
return strings.Join(pieces, " ")
}

func getRandomPublicID() string {
Expand Down
Loading

0 comments on commit b99f951

Please sign in to comment.