From 82bd3b6df1c3d379a586c5b4e6c29a7ec41ce86d Mon Sep 17 00:00:00 2001 From: Ivy Gesare <83957195+Gesare5@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:23:44 +0300 Subject: [PATCH] [MM-61762] Fix errcheck issues in server/channels/app/platform/config_test.go (#29323) Co-authored-by: Ben Schumacher --- server/.golangci.yml | 1 - server/channels/app/platform/config_test.go | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 04e01aac882..f39a6175df9 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -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|\ diff --git a/server/channels/app/platform/config_test.go b/server/channels/app/platform/config_test.go index 83cde4ee0d3..5968365b3c5 100644 --- a/server/channels/app/platform/config_test.go +++ b/server/channels/app/platform/config_test.go @@ -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) {