diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-02 03:50:56 -0500 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-10-02 09:50:56 +0100 |
commit | 9bc7af0c5704bbf73f8240b4569d5ea215352e39 (patch) | |
tree | b17ddafc83ab43ccdce2116e83358299a08a50a6 /api4/system_test.go | |
parent | b84736e9b6401df0c6eeab9950bef09458a6aefd (diff) | |
download | chat-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 'api4/system_test.go')
-rw-r--r-- | api4/system_test.go | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/api4/system_test.go b/api4/system_test.go index 426752b58..76dac5316 100644 --- a/api4/system_test.go +++ b/api4/system_test.go @@ -6,13 +6,18 @@ import ( "testing" l4g "github.com/alecthomas/log4go" + "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" ) +func init() { + app.UseGlobalApp = false +} + func TestGetPing(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client goRoutineHealthThreshold := *utils.Cfg.ServiceSettings.GoroutineHealthThreshold @@ -36,7 +41,7 @@ func TestGetPing(t *testing.T) { func TestGetConfig(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client _, resp := Client.GetConfig() @@ -83,7 +88,7 @@ func TestGetConfig(t *testing.T) { func TestReloadConfig(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client flag, resp := Client.ReloadConfig() @@ -104,7 +109,7 @@ func TestReloadConfig(t *testing.T) { func TestUpdateConfig(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client cfg := th.App.GetConfig() @@ -144,7 +149,7 @@ func TestUpdateConfig(t *testing.T) { func TestGetOldClientConfig(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client config, resp := Client.GetOldClientConfig("") @@ -170,7 +175,7 @@ func TestGetOldClientConfig(t *testing.T) { func TestGetOldClientLicense(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client license, resp := Client.GetOldClientLicense("") @@ -203,7 +208,7 @@ func TestGetOldClientLicense(t *testing.T) { func TestGetAudits(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client audits, resp := th.SystemAdminClient.GetAudits(0, 100, "") @@ -240,7 +245,7 @@ func TestGetAudits(t *testing.T) { func TestEmailTest(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client SendEmailNotifications := utils.Cfg.EmailSettings.SendEmailNotifications @@ -269,7 +274,7 @@ func TestEmailTest(t *testing.T) { func TestDatabaseRecycle(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client _, resp := Client.DatabaseRecycle() @@ -281,7 +286,7 @@ func TestDatabaseRecycle(t *testing.T) { func TestInvalidateCaches(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client flag, resp := Client.InvalidateCaches() @@ -299,7 +304,7 @@ func TestInvalidateCaches(t *testing.T) { func TestGetLogs(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client for i := 0; i < 20; i++ { @@ -339,7 +344,7 @@ func TestGetLogs(t *testing.T) { func TestPostLog(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client message := make(map[string]string) @@ -358,7 +363,7 @@ func TestPostLog(t *testing.T) { func TestUploadLicenseFile(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client ok, resp := Client.UploadLicenseFile([]byte{}) @@ -376,7 +381,7 @@ func TestUploadLicenseFile(t *testing.T) { func TestRemoveLicenseFile(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client ok, resp := Client.RemoveLicenseFile() @@ -394,7 +399,7 @@ func TestRemoveLicenseFile(t *testing.T) { func TestGetAnalyticsOld(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() - defer TearDown() + defer th.TearDown() Client := th.Client rows, resp := Client.GetAnalyticsOld("", "") |