Refactoring cfg refs and load / save functions (#7749)

* refactoring cfg refs and load / save functions

* improve error output
Этот коммит содержится в:
Chris
2017-10-31 09:39:31 -05:00
коммит произвёл Joram Wilander
родитель b446d0aa0a
Коммит ce2b2be5de
28 изменённых файлов: 250 добавлений и 247 удалений

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

@@ -48,12 +48,6 @@ func StopTestStore() {
}
func setupTestHelper(enterprise bool) *TestHelper {
if utils.T == nil {
utils.TranslationsPreInit()
}
utils.LoadConfig("config.json")
utils.InitTranslations(utils.Cfg.LocalizationSettings)
var options []Option
if testStore != nil {
options = append(options, StoreOverride(testStore))
@@ -63,8 +57,8 @@ func setupTestHelper(enterprise bool) *TestHelper {
App: New(options...),
}
*utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
*utils.Cfg.RateLimitSettings.Enable = false
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.MaxUsersPerTeam = 50 })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.RateLimitSettings.Enable = false })
utils.DisableDebugLogForTest()
prevListenAddress := *th.App.Config().ServiceSettings.ListenAddress
if testStore != nil {
@@ -76,7 +70,7 @@ func setupTestHelper(enterprise bool) *TestHelper {
utils.EnableDebugLogForTest()
th.App.Srv.Store.MarkSystemRanUnitTests()
*utils.Cfg.TeamSettings.EnableOpenServer = true
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = true })
utils.SetIsLicensed(enterprise)
if enterprise {