From a24d98fe44fcd713674094386ed76dde8642a407 Mon Sep 17 00:00:00 2001 From: Charandas Batra Date: Fri, 14 Feb 2025 14:58:47 -0800 Subject: [PATCH] don't require tracer for contexthandler --- pkg/api/common_test.go | 1 - pkg/middleware/auth_test.go | 3 +-- pkg/middleware/middleware_test.go | 4 +--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/api/common_test.go b/pkg/api/common_test.go index 0072b068de8..d324831b075 100644 --- a/pkg/api/common_test.go +++ b/pkg/api/common_test.go @@ -189,7 +189,6 @@ func getContextHandler(t *testing.T, cfg *setting.Cfg) *contexthandler.ContextHa return contexthandler.ProvideService( cfg, - tracing.InitializeTracerForTest(), &authntest.FakeService{ExpectedIdentity: &authn.Identity{ID: "0", Type: claims.TypeAnonymous, SessionToken: &usertoken.UserToken{}}}, featuremgmt.WithFeatures(), ) diff --git a/pkg/middleware/auth_test.go b/pkg/middleware/auth_test.go index c7f2eb1d655..b9b83ae9bae 100644 --- a/pkg/middleware/auth_test.go +++ b/pkg/middleware/auth_test.go @@ -13,7 +13,6 @@ import ( authlib "github.com/grafana/authlib/types" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log/logtest" - "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/services/accesscontrol/actest" "github.com/grafana/grafana/pkg/services/authn" @@ -30,7 +29,7 @@ import ( ) func setupAuthMiddlewareTest(t *testing.T, identity *authn.Identity, authErr error) *contexthandler.ContextHandler { - return contexthandler.ProvideService(setting.NewCfg(), tracing.InitializeTracerForTest(), &authntest.FakeService{ + return contexthandler.ProvideService(setting.NewCfg(), &authntest.FakeService{ ExpectedErr: authErr, ExpectedIdentity: identity, }, featuremgmt.WithFeatures()) diff --git a/pkg/middleware/middleware_test.go b/pkg/middleware/middleware_test.go index bd447ab5779..1cf18c20824 100644 --- a/pkg/middleware/middleware_test.go +++ b/pkg/middleware/middleware_test.go @@ -14,7 +14,6 @@ import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/infra/fs" "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/services/authn" "github.com/grafana/grafana/pkg/services/authn/authntest" "github.com/grafana/grafana/pkg/services/contexthandler" @@ -290,6 +289,5 @@ func middlewareScenario(t *testing.T, desc string, fn scenarioFunc, cbs ...func( func getContextHandler(t *testing.T, cfg *setting.Cfg, authnService authn.Service) *contexthandler.ContextHandler { t.Helper() - tracer := tracing.InitializeTracerForTest() - return contexthandler.ProvideService(cfg, tracer, authnService, featuremgmt.WithFeatures()) + return contexthandler.ProvideService(cfg, authnService, featuremgmt.WithFeatures()) }