* app cleanup

* whoops, forgot a file

* some minor cleanup

* longer container deadline

* defensive checks
Этот коммит содержится в:
Chris
2017-10-09 14:59:48 -07:00
коммит произвёл GitHub
родитель 0f66b6e726
Коммит bff2b5e735
22 изменённых файлов: 165 добавлений и 166 удалений

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

@@ -109,12 +109,6 @@ type API struct {
BaseRoutes *Routes
}
func NewRouter() *mux.Router {
ret := mux.NewRouter()
ret.NotFoundHandler = http.HandlerFunc(Handle404)
return ret
}
func Init(a *app.App, root *mux.Router, full bool) *API {
api := &API{
App: a,

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

@@ -46,38 +46,31 @@ 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()
Init(th.App, th.App.Srv.Router, true)
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()
Init(th.App, th.App.Srv.Router, true)
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 {
utils.License().Features.SetDefaults()
}
th.App.Jobs.Store = th.App.Srv.Store
th.Client = th.CreateClient()
th.SystemAdminClient = th.CreateClient()
return th