PLT-2298 fixing ephemeral message for loadtests (#2788)

* PLT-2298 fixing ephemeral message for loadtests

* Fixing unit tests
Этот коммит содержится в:
Corey Hulen
2016-04-25 05:39:02 -07:00
коммит произвёл Joram Wilander
родитель a9cde2b0f9
Коммит 1daa0d6b3e
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@@ -201,7 +201,7 @@ func (me *LoadTestProvider) SetupCommand(c *Context, channelId string, message s
doFuzz)
}
return &model.CommandResponse{Text: "Creating enviroment...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
return &model.CommandResponse{Text: "Created enviroment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func (me *LoadTestProvider) UsersCommand(c *Context, channelId string, message string) *model.CommandResponse {
@@ -231,7 +231,7 @@ func (me *LoadTestProvider) UsersCommand(c *Context, channelId string, message s
userCreator.Fuzzy = doFuzz
userCreator.CreateTestUsers(usersr)
return &model.CommandResponse{Text: "Adding users...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
return &model.CommandResponse{Text: "Added users", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func (me *LoadTestProvider) ChannelsCommand(c *Context, channelId string, message string) *model.CommandResponse {
@@ -262,7 +262,7 @@ func (me *LoadTestProvider) ChannelsCommand(c *Context, channelId string, messag
channelCreator.Fuzzy = doFuzz
channelCreator.CreateTestChannels(channelsr)
return &model.CommandResponse{Text: "Adding channels...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
return &model.CommandResponse{Text: "Added channels", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func (me *LoadTestProvider) PostsCommand(c *Context, channelId string, message string) *model.CommandResponse {
@@ -312,7 +312,7 @@ func (me *LoadTestProvider) PostsCommand(c *Context, channelId string, message s
testPoster.CreateRandomPost()
}
return &model.CommandResponse{Text: "Adding posts...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
return &model.CommandResponse{Text: "Added posts", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func (me *LoadTestProvider) UrlCommand(c *Context, channelId string, message string) *model.CommandResponse {
@@ -361,7 +361,7 @@ func (me *LoadTestProvider) UrlCommand(c *Context, channelId string, message str
}
}
return &model.CommandResponse{Text: "Loading data...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
return &model.CommandResponse{Text: "Loaded data", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func (me *LoadTestProvider) JsonCommand(c *Context, channelId string, message string) *model.CommandResponse {
@@ -397,7 +397,7 @@ func (me *LoadTestProvider) JsonCommand(c *Context, channelId string, message st
if _, err := CreatePost(c, post, false); err != nil {
return &model.CommandResponse{Text: "Unable to create post", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
return &model.CommandResponse{Text: "Loading data...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
return &model.CommandResponse{Text: "Loaded data", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func parseRange(command string, cmd string) (utils.Range, bool) {

Просмотреть файл

@@ -47,7 +47,7 @@ func TestLoadTestSetupCommands(t *testing.T) {
utils.Cfg.ServiceSettings.EnableTesting = true
rs := Client.Must(Client.Command(channel.Id, "/loadtest setup fuzz 1 1 1", false)).Data.(*model.CommandResponse)
if rs.Text != "Creating enviroment..." {
if rs.Text != "Created enviroment" {
t.Fatal(rs.Text)
}
@@ -68,7 +68,7 @@ func TestLoadTestUsersCommands(t *testing.T) {
utils.Cfg.ServiceSettings.EnableTesting = true
rs := Client.Must(Client.Command(channel.Id, "/loadtest users fuzz 1 2", false)).Data.(*model.CommandResponse)
if rs.Text != "Adding users..." {
if rs.Text != "Added users" {
t.Fatal(rs.Text)
}
@@ -89,7 +89,7 @@ func TestLoadTestChannelsCommands(t *testing.T) {
utils.Cfg.ServiceSettings.EnableTesting = true
rs := Client.Must(Client.Command(channel.Id, "/loadtest channels fuzz 1 2", false)).Data.(*model.CommandResponse)
if rs.Text != "Adding channels..." {
if rs.Text != "Added channels" {
t.Fatal(rs.Text)
}
@@ -110,7 +110,7 @@ func TestLoadTestPostsCommands(t *testing.T) {
utils.Cfg.ServiceSettings.EnableTesting = true
rs := Client.Must(Client.Command(channel.Id, "/loadtest posts fuzz 2 3 2", false)).Data.(*model.CommandResponse)
if rs.Text != "Adding posts..." {
if rs.Text != "Added posts" {
t.Fatal(rs.Text)
}
@@ -142,7 +142,7 @@ func TestLoadTestUrlCommands(t *testing.T) {
}
command = "/loadtest url https://raw.githubusercontent.com/mattermost/platform/master/README.md"
if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading data..." {
if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loaded data" {
t.Fatal("/loadtest url for README.md should've executed")
}
@@ -192,7 +192,7 @@ func TestLoadTestJsonCommands(t *testing.T) {
}
command = "/loadtest json test-slack-attachments"
if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading data..." {
if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loaded data" {
t.Fatal("/loadtest json should've executed")
}