( ctx context.Context, t *testing.T, db database.Store, addOptionsFn func(opts telemetry.Options) telemetry.Options, )
| 1405 | } |
| 1406 | |
| 1407 | func collectSnapshot( |
| 1408 | ctx context.Context, |
| 1409 | t *testing.T, |
| 1410 | db database.Store, |
| 1411 | addOptionsFn func(opts telemetry.Options) telemetry.Options, |
| 1412 | ) (*telemetry.Deployment, *telemetry.Snapshot) { |
| 1413 | t.Helper() |
| 1414 | |
| 1415 | serverURL, deployment, snapshot := mockTelemetryServer(ctx, t) |
| 1416 | |
| 1417 | options := telemetry.Options{ |
| 1418 | Database: db, |
| 1419 | Logger: testutil.Logger(t), |
| 1420 | URL: serverURL, |
| 1421 | DeploymentID: uuid.NewString(), |
| 1422 | } |
| 1423 | if addOptionsFn != nil { |
| 1424 | options = addOptionsFn(options) |
| 1425 | } |
| 1426 | |
| 1427 | reporter, err := telemetry.New(options) |
| 1428 | require.NoError(t, err) |
| 1429 | t.Cleanup(reporter.Close) |
| 1430 | |
| 1431 | return testutil.RequireReceive(ctx, t, deployment), testutil.RequireReceive(ctx, t, snapshot) |
| 1432 | } |
| 1433 | |
| 1434 | func TestTelemetry_BoundaryUsageSummary(t *testing.T) { |
| 1435 | t.Parallel() |
no test coverage detected