summaryrefslogtreecommitdiffstats
path: root/api/cli_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-02 03:50:56 -0500
committerGeorge Goldberg <george@gberg.me>2017-10-02 09:50:56 +0100
commit9bc7af0c5704bbf73f8240b4569d5ea215352e39 (patch)
treeb17ddafc83ab43ccdce2116e83358299a08a50a6 /api/cli_test.go
parentb84736e9b6401df0c6eeab9950bef09458a6aefd (diff)
downloadchat-9bc7af0c5704bbf73f8240b4569d5ea215352e39.tar.gz
chat-9bc7af0c5704bbf73f8240b4569d5ea215352e39.tar.bz2
chat-9bc7af0c5704bbf73f8240b4569d5ea215352e39.zip
Don't use global app for api / api4 tests (#7528)
* don't use global app for api / api4 tests * put sleep back. we're gonna have to do some goroutine wrangling * fix oauth test config assumptions * jobs package, i'm comin' for you next * app test fix * try increasing sleep a little
Diffstat (limited to 'api/cli_test.go')
-rw-r--r--api/cli_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/api/cli_test.go b/api/cli_test.go
index 14645f35c..c1e30635d 100644
--- a/api/cli_test.go
+++ b/api/cli_test.go
@@ -30,6 +30,7 @@ func TestCliCreateTeam(t *testing.T) {
}
th := Setup().InitSystemAdmin()
+ defer th.TearDown()
id := model.NewId()
name := "name" + id
@@ -55,6 +56,7 @@ func TestCliCreateUserWithTeam(t *testing.T) {
}
th := Setup().InitSystemAdmin()
+ defer th.TearDown()
id := model.NewId()
email := "success+" + id + "@simulator.amazonses.com"
@@ -96,6 +98,8 @@ func TestCliCreateUserWithoutTeam(t *testing.T) {
}
th := Setup()
+ defer th.TearDown()
+
id := model.NewId()
email := "success+" + id + "@simulator.amazonses.com"
username := "name" + id
@@ -123,6 +127,7 @@ func TestCliAssignRole(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go roles system_admin "+th.BasicUser.Email)
output, err := cmd.CombinedOutput()
@@ -147,6 +152,8 @@ func TestCliJoinChannel(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
+
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel add "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
@@ -179,6 +186,8 @@ func TestCliRemoveChannel(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
+
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel add "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
@@ -218,6 +227,8 @@ func TestCliListChannels(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
+
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
th.BasicClient.Must(th.BasicClient.DeleteChannel(channel.Id))
@@ -243,6 +254,8 @@ func TestCliRestoreChannel(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
+
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
th.BasicClient.Must(th.BasicClient.DeleteChannel(channel.Id))
@@ -268,6 +281,7 @@ func TestCliJoinTeam(t *testing.T) {
}
th := Setup().InitSystemAdmin().InitBasic()
+ defer th.TearDown()
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go team add "+th.SystemAdminTeam.Name+" "+th.BasicUser.Email)
output, err := cmd.CombinedOutput()
@@ -298,6 +312,7 @@ func TestCliLeaveTeam(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go team remove "+th.BasicTeam.Name+" "+th.BasicUser.Email)
output, err := cmd.CombinedOutput()
@@ -335,6 +350,7 @@ func TestCliResetPassword(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go user password "+th.BasicUser.Email+" password2")
output, err := cmd.CombinedOutput()
@@ -354,6 +370,7 @@ func TestCliCreateChannel(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
id := model.NewId()
name := "name" + id
@@ -380,6 +397,7 @@ func TestCliMakeUserActiveAndInactive(t *testing.T) {
}
th := Setup().InitBasic()
+ defer th.TearDown()
// first inactivate the user
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go user deactivate "+th.BasicUser.Email)