[MM-61762] Fix errcheck issues in server/channels/app/platform/config_test.go (#29323)

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
This commit is contained in:
Ivy Gesare 2024-11-20 14:23:44 +03:00 committed by GitHub
parent 297aab56a0
commit 82bd3b6df1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -101,7 +101,6 @@ issues:
channels/app/permissions.go|\
channels/app/permissions_test.go|\
channels/app/platform/cluster_handlers.go|\
channels/app/platform/config_test.go|\
channels/app/platform/helper_test.go|\
channels/app/platform/license.go|\
channels/app/platform/link_cache.go|\

View file

@ -88,16 +88,19 @@ func TestConfigSave(t *testing.T) {
// Change a random config setting
cfg := th.Service.Config().Clone()
cfg.ThemeSettings.EnableThemeSelection = model.NewPointer(!*cfg.ThemeSettings.EnableThemeSelection)
th.Service.SaveConfig(cfg, false)
_, _, appErr := th.Service.SaveConfig(cfg, false)
require.Nil(t, appErr)
metricsMock.AssertNumberOfCalls(t, "Register", 0)
// Disable metrics
cfg.MetricsSettings.Enable = model.NewPointer(false)
th.Service.SaveConfig(cfg, false)
_, _, appErr = th.Service.SaveConfig(cfg, false)
require.Nil(t, appErr)
// Change the metrics setting
cfg.MetricsSettings.Enable = model.NewPointer(true)
th.Service.SaveConfig(cfg, false)
_, _, appErr = th.Service.SaveConfig(cfg, false)
require.Nil(t, appErr)
metricsMock.AssertNumberOfCalls(t, "Register", 1)
})
}
@ -126,7 +129,8 @@ func TestIsFirstUserAccount(t *testing.T) {
}
// create a session, this should not affect IsFirstUserAccount
th.Service.sessionCache.SetWithDefaultExpiry("mock_session", 1)
err := th.Service.sessionCache.SetWithDefaultExpiry("mock_session", 1)
require.NoError(t, err)
for _, te := range tests {
t.Run(te.name, func(t *testing.T) {