Miscellaneous app cleanup (#7594)

* app cleanup

* whoops, forgot a file

* some minor cleanup

* longer container deadline

* defensive checks
This commit is contained in:
Chris
2017-10-09 14:59:48 -07:00
committed by GitHub
parent 0f66b6e726
commit bff2b5e735
22 changed files with 165 additions and 166 deletions

View File

@@ -34,31 +34,26 @@ type TestHelper struct {
}
func setupTestHelper(enterprise bool) *TestHelper {
utils.TranslationsPreInit()
utils.LoadConfig("config.json")
utils.InitTranslations(utils.Cfg.LocalizationSettings)
th := &TestHelper{
App: app.New(),
}
if th.App.Srv == nil {
utils.TranslationsPreInit()
utils.LoadConfig("config.json")
utils.InitTranslations(utils.Cfg.LocalizationSettings)
*utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
*utils.Cfg.RateLimitSettings.Enable = false
utils.Cfg.EmailSettings.SendEmailNotifications = true
utils.DisableDebugLogForTest()
th.App.NewServer()
th.App.InitStores()
th.App.Srv.Router = NewRouter()
th.App.Srv.WebSocketRouter = th.App.NewWebSocketRouter()
th.App.StartServer()
api4.Init(th.App, th.App.Srv.Router, false)
Init(th.App, th.App.Srv.Router)
wsapi.Init(th.App, th.App.Srv.WebSocketRouter)
utils.EnableDebugLogForTest()
th.App.Srv.Store.MarkSystemRanUnitTests()
*utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
*utils.Cfg.RateLimitSettings.Enable = false
utils.Cfg.EmailSettings.SendEmailNotifications = true
utils.DisableDebugLogForTest()
th.App.StartServer()
api4.Init(th.App, th.App.Srv.Router, false)
Init(th.App, th.App.Srv.Router)
wsapi.Init(th.App, th.App.Srv.WebSocketRouter)
utils.EnableDebugLogForTest()
th.App.Srv.Store.MarkSystemRanUnitTests()
*utils.Cfg.TeamSettings.EnableOpenServer = true
}
*utils.Cfg.TeamSettings.EnableOpenServer = true
utils.SetIsLicensed(enterprise)
if enterprise {