[MM-55990] Logger improvements for tests (#25467)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bd71288731
Коммит
c395ec6245
@@ -97,6 +97,8 @@ func setupTestHelper(dbStore store.Store, searchEngine *searchengine.Broker, ent
|
||||
*memoryConfig.PluginSettings.ClientDirectory = filepath.Join(tempWorkspace, "webapp")
|
||||
memoryConfig.ServiceSettings.EnableLocalMode = model.NewBool(true)
|
||||
*memoryConfig.ServiceSettings.LocalModeSocketLocation = filepath.Join(tempWorkspace, "mattermost_local.sock")
|
||||
*memoryConfig.LogSettings.EnableSentry = false // disable error reporting during tests
|
||||
*memoryConfig.LogSettings.ConsoleLevel = mlog.LvlStdLog.Name
|
||||
*memoryConfig.AnnouncementSettings.AdminNoticesEnabled = false
|
||||
*memoryConfig.AnnouncementSettings.UserNoticesEnabled = false
|
||||
*memoryConfig.PluginSettings.AutomaticPrepackagedPlugins = false
|
||||
|
||||
@@ -640,6 +640,13 @@ func TestPatchConfig(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
// Ensure ConsoleLevel is set to DEBUG
|
||||
config := model.Config{LogSettings: model.LogSettings{
|
||||
ConsoleLevel: model.NewString("DEBUG"),
|
||||
}}
|
||||
_, _, err := th.SystemAdminClient.PatchConfig(context.Background(), &config)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("config is missing", func(t *testing.T) {
|
||||
_, response, err := th.Client.PatchConfig(context.Background(), nil)
|
||||
require.Error(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user