User: Add tracing (#87028)

* Inject tracer in tests

* Annotate with traces

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
Karl Persson
2024-04-30 13:15:56 +02:00
committed by GitHub
co-authored by Gabriel MABILLE
parent 7f1b2ef205
commit a2cba3d0b5
31 changed files with 368 additions and 202 deletions
+12 -4
View File
@@ -51,8 +51,10 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
quotaService := quotaimpl.ProvideService(sqlStore, cfg)
orgSvc, err := orgimpl.ProvideService(sqlStore, cfg, quotaService)
require.NoError(t, err)
userSvc, err := userimpl.ProvideService(sqlStore, orgSvc, cfg, teamSvc, nil, quotaService,
supportbundlestest.NewFakeBundleService())
userSvc, err := userimpl.ProvideService(
sqlStore, orgSvc, cfg, teamSvc, nil, tracing.InitializeTracerForTest(),
quotaService, supportbundlestest.NewFakeBundleService(),
)
require.NoError(t, err)
t.Run("Given saved users and two teams", func(t *testing.T) {
@@ -436,7 +438,10 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
quotaService := quotaimpl.ProvideService(sqlStore, cfg)
orgSvc, err := orgimpl.ProvideService(sqlStore, cfg, quotaService)
require.NoError(t, err)
userSvc, err := userimpl.ProvideService(sqlStore, orgSvc, cfg, teamSvc, nil, quotaService, supportbundlestest.NewFakeBundleService())
userSvc, err := userimpl.ProvideService(
sqlStore, orgSvc, cfg, teamSvc, nil, tracing.InitializeTracerForTest(),
quotaService, supportbundlestest.NewFakeBundleService(),
)
require.NoError(t, err)
setup()
userCmd = user.CreateUserCommand{
@@ -571,7 +576,10 @@ func TestIntegrationSQLStore_GetTeamMembers_ACFilter(t *testing.T) {
quotaService := quotaimpl.ProvideService(store, cfg)
orgSvc, err := orgimpl.ProvideService(store, cfg, quotaService)
require.NoError(t, err)
userSvc, err := userimpl.ProvideService(store, orgSvc, cfg, teamSvc, nil, quotaService, supportbundlestest.NewFakeBundleService())
userSvc, err := userimpl.ProvideService(
store, orgSvc, cfg, teamSvc, nil, tracing.InitializeTracerForTest(),
quotaService, supportbundlestest.NewFakeBundleService(),
)
require.NoError(t, err)
for i := 0; i < 4; i++ {