summaryrefslogtreecommitdiffstats
path: root/web/web_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'web/web_test.go')
-rw-r--r--web/web_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/web_test.go b/web/web_test.go
index 09460b3b0..12099709e 100644
--- a/web/web_test.go
+++ b/web/web_test.go
@@ -11,6 +11,7 @@ import (
"github.com/mattermost/mattermost-server/api"
"github.com/mattermost/mattermost-server/api4"
"github.com/mattermost/mattermost-server/app"
+ "github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/store"
"github.com/mattermost/mattermost-server/store/sqlstore"
@@ -150,6 +151,15 @@ func TestIncomingWebhook(t *testing.T) {
}
func TestMain(m *testing.M) {
+ // Setup a global logger to catch tests logging outside of app context
+ // The global logger will be stomped by apps initalizing but that's fine for testing. Ideally this won't happen.
+ mlog.InitGlobalLogger(mlog.NewLogger(&mlog.LoggerConfiguration{
+ EnableConsole: true,
+ ConsoleJson: true,
+ ConsoleLevel: "error",
+ EnableFile: false,
+ }))
+
utils.TranslationsPreInit()
status := 0