From 5e2461d2d78f97944cfbb480fff322dffbcb4f83 Mon Sep 17 00:00:00 2001 From: dekiel Date: Thu, 9 Jan 2025 14:31:51 +0100 Subject: [PATCH] Fixed tests errors. --- pkg/oidc/oidc_test.go | 2 -- pkg/oidc/oidc_unit_test.go | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkg/oidc/oidc_test.go b/pkg/oidc/oidc_test.go index 2f688a71a4e2..fba1cf138778 100644 --- a/pkg/oidc/oidc_test.go +++ b/pkg/oidc/oidc_test.go @@ -276,8 +276,6 @@ var _ = Describe("OIDC", func() { Verifier: verifier, Logger: logger, } - // verifierConfig, err = tioidc.NewVerifierConfig(logger, clientID) - Expect(err).NotTo(HaveOccurred()) ctx = context.Background() rawToken, err = os.ReadFile("test-fixtures/raw-oidc-token") Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/oidc/oidc_unit_test.go b/pkg/oidc/oidc_unit_test.go index 9060ffb57f18..0b427ae82992 100644 --- a/pkg/oidc/oidc_unit_test.go +++ b/pkg/oidc/oidc_unit_test.go @@ -11,6 +11,16 @@ import ( ) var _ = Describe("OIDC", func() { + var ( + logger *zap.SugaredLogger + ) + BeforeEach(func() { + l, err := zap.NewDevelopment() + Expect(err).NotTo(HaveOccurred()) + + logger = l.Sugar() + }) + Describe("maskToken", func() { It("should mask the token if length is less than 15", func() { token := "shorttoken" @@ -41,7 +51,6 @@ var _ = Describe("OIDC", func() { var ( tokenProcessor TokenProcessor err error - logger *zap.SugaredLogger trustedIssuers map[string]Issuer rawToken []byte ) @@ -74,4 +83,4 @@ var _ = Describe("OIDC", func() { }) }) }) -}) \ No newline at end of file +})