From f4b3c15c306bf1b14b5cc4d37e1a42726763414d Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Fri, 26 Jan 2024 09:34:45 +0100 Subject: [PATCH] update tests to use the new logger API --- internal/pkg/agent/application/coordinator/coordinator_test.go | 2 +- internal/pkg/agent/application/upgrade/cleanup_test.go | 2 +- internal/pkg/agent/protection/policy_test.go | 2 +- internal/pkg/basecmd/version/cmd_test.go | 2 +- internal/pkg/composable/providers/kubernetes/pod_test.go | 2 +- internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go | 2 +- internal/pkg/testutils/testutils.go | 2 +- pkg/control/v2/control_test.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/pkg/agent/application/coordinator/coordinator_test.go b/internal/pkg/agent/application/coordinator/coordinator_test.go index 49770bc1e97..0a86af983e9 100644 --- a/internal/pkg/agent/application/coordinator/coordinator_test.go +++ b/internal/pkg/agent/application/coordinator/coordinator_test.go @@ -614,7 +614,7 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + log, err := logger.NewFromConfig("", loggerCfg, nil, false) require.NoError(t, err) return log } diff --git a/internal/pkg/agent/application/upgrade/cleanup_test.go b/internal/pkg/agent/application/upgrade/cleanup_test.go index 1170c26946d..07255b8870a 100644 --- a/internal/pkg/agent/application/upgrade/cleanup_test.go +++ b/internal/pkg/agent/application/upgrade/cleanup_test.go @@ -52,7 +52,7 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + log, err := logger.NewFromConfig("", loggerCfg, nil, false) require.NoError(t, err) return log } diff --git a/internal/pkg/agent/protection/policy_test.go b/internal/pkg/agent/protection/policy_test.go index 80934d32b99..0e3673c3af5 100644 --- a/internal/pkg/agent/protection/policy_test.go +++ b/internal/pkg/agent/protection/policy_test.go @@ -18,7 +18,7 @@ import ( func getLogger() *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.DebugLevel - l, _ := logger.NewFromConfig("", loggerCfg, false) + l, _ := logger.NewFromConfig("", loggerCfg, nil, false) return l } diff --git a/internal/pkg/basecmd/version/cmd_test.go b/internal/pkg/basecmd/version/cmd_test.go index 93ed88101e2..44e276a1552 100644 --- a/internal/pkg/basecmd/version/cmd_test.go +++ b/internal/pkg/basecmd/version/cmd_test.go @@ -135,7 +135,7 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + log, err := logger.NewFromConfig("", loggerCfg, nil, false) require.NoError(t, err) return log } diff --git a/internal/pkg/composable/providers/kubernetes/pod_test.go b/internal/pkg/composable/providers/kubernetes/pod_test.go index 7409ad1a3ea..580f55b7e92 100644 --- a/internal/pkg/composable/providers/kubernetes/pod_test.go +++ b/internal/pkg/composable/providers/kubernetes/pod_test.go @@ -27,7 +27,7 @@ import ( func getLogger() *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - l, _ := logger.NewFromConfig("", loggerCfg, false) + l, _ := logger.NewFromConfig("", loggerCfg, nil, false) return l } diff --git a/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go b/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go index 3766a57fbf4..5577f1e9cf8 100644 --- a/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go +++ b/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go @@ -87,7 +87,7 @@ func TestLazyAcker(t *testing.T) { cfg.Level = logp.DebugLevel // cfg.ToFiles = false cfg.ToStderr = true - log, _ := logger.NewFromConfig("", cfg, true) + log, _ := logger.NewFromConfig("", cfg, nil, true) // Tests tests := []struct { diff --git a/internal/pkg/testutils/testutils.go b/internal/pkg/testutils/testutils.go index 4c3c0781cca..d554033f1a4 100644 --- a/internal/pkg/testutils/testutils.go +++ b/internal/pkg/testutils/testutils.go @@ -37,7 +37,7 @@ func NewErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + log, err := logger.NewFromConfig("", loggerCfg, nil, false) require.NoError(t, err) return log } diff --git a/pkg/control/v2/control_test.go b/pkg/control/v2/control_test.go index 768407e6042..4f785bda80a 100644 --- a/pkg/control/v2/control_test.go +++ b/pkg/control/v2/control_test.go @@ -50,7 +50,7 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + log, err := logger.NewFromConfig("", loggerCfg, nil, false) require.NoError(t, err) return log }