Switch creation of users to use app method vs client method (#16673)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5a7759f4d6
Коммит
81b06b5b72
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
UserPassword = "passwd"
|
UserPassword = "Usr@MMTest123"
|
||||||
ChannelType = model.CHANNEL_OPEN
|
ChannelType = model.CHANNEL_OPEN
|
||||||
BTestTeamDisplayName = "TestTeam"
|
BTestTeamDisplayName = "TestTeam"
|
||||||
BTestTeamName = "z-z-testdomaina"
|
BTestTeamName = "z-z-testdomaina"
|
||||||
|
|||||||
@@ -93,9 +93,9 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, error) {
|
|||||||
Nickname: userName,
|
Nickname: userName,
|
||||||
Password: UserPassword}
|
Password: UserPassword}
|
||||||
|
|
||||||
ruser, resp := cfg.client.CreateUserWithInviteId(user, cfg.team.InviteId)
|
ruser, appErr := cfg.app.CreateUserWithInviteId(user, cfg.team.InviteId, "")
|
||||||
if resp.Error != nil {
|
if appErr != nil {
|
||||||
return nil, resp.Error
|
return nil, appErr
|
||||||
}
|
}
|
||||||
|
|
||||||
status := &model.Status{UserId: ruser.Id, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""}
|
status := &model.Status{UserId: ruser.Id, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""}
|
||||||
|
|||||||
@@ -294,7 +294,9 @@ func (*LoadTestProvider) UsersCommand(a *app.App, args *model.CommandArgs, messa
|
|||||||
client := model.NewAPIv4Client(args.SiteURL)
|
client := model.NewAPIv4Client(args.SiteURL)
|
||||||
userCreator := NewAutoUserCreator(a, client, team)
|
userCreator := NewAutoUserCreator(a, client, team)
|
||||||
userCreator.Fuzzy = doFuzz
|
userCreator.Fuzzy = doFuzz
|
||||||
userCreator.CreateTestUsers(usersr)
|
if _, err := userCreator.CreateTestUsers(usersr); err != nil {
|
||||||
|
return &model.CommandResponse{Text: "Failed to add users: " + err.Error(), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, err
|
||||||
|
}
|
||||||
|
|
||||||
return &model.CommandResponse{Text: "Added users", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, nil
|
return &model.CommandResponse{Text: "Added users", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user