Merge pull request #717 from mattermost/fix-loadtest
Fix authentication for server load tests.
Этот коммит содержится в:
@@ -341,7 +341,7 @@ func loadTestSetupCommand(c *Context, command *model.Command) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
client.MockSession(c.Session.Id)
|
client.MockSession(c.Session.Token)
|
||||||
CreateTestEnviromentInTeam(
|
CreateTestEnviromentInTeam(
|
||||||
client,
|
client,
|
||||||
c.Session.TeamId,
|
c.Session.TeamId,
|
||||||
@@ -406,7 +406,7 @@ func loadTestChannelsCommand(c *Context, command *model.Command) bool {
|
|||||||
channelsr = utils.Range{20, 30}
|
channelsr = utils.Range{20, 30}
|
||||||
}
|
}
|
||||||
client := model.NewClient(c.GetSiteURL())
|
client := model.NewClient(c.GetSiteURL())
|
||||||
client.MockSession(c.Session.Id)
|
client.MockSession(c.Session.Token)
|
||||||
channelCreator := NewAutoChannelCreator(client, c.Session.TeamId)
|
channelCreator := NewAutoChannelCreator(client, c.Session.TeamId)
|
||||||
channelCreator.Fuzzy = doFuzz
|
channelCreator.Fuzzy = doFuzz
|
||||||
channelCreator.CreateTestChannels(channelsr)
|
channelCreator.CreateTestChannels(channelsr)
|
||||||
@@ -458,7 +458,7 @@ func loadTestPostsCommand(c *Context, command *model.Command) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
client := model.NewClient(c.GetSiteURL())
|
client := model.NewClient(c.GetSiteURL())
|
||||||
client.MockSession(c.Session.Id)
|
client.MockSession(c.Session.Token)
|
||||||
testPoster := NewAutoPostCreator(client, command.ChannelId)
|
testPoster := NewAutoPostCreator(client, command.ChannelId)
|
||||||
testPoster.Fuzzy = doFuzz
|
testPoster.Fuzzy = doFuzz
|
||||||
testPoster.Users = usernames
|
testPoster.Users = usernames
|
||||||
|
|||||||
@@ -790,4 +790,5 @@ func (c *Client) GetAccessToken(data url.Values) (*Result, *AppError) {
|
|||||||
|
|
||||||
func (c *Client) MockSession(sessionToken string) {
|
func (c *Client) MockSession(sessionToken string) {
|
||||||
c.AuthToken = sessionToken
|
c.AuthToken = sessionToken
|
||||||
|
c.AuthType = HEADER_BEARER
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user