TestTrackServerStart tests long-running server command tracking
(t *testing.T)
| 536 | |
| 537 | // TestTrackServerStart tests long-running server command tracking |
| 538 | func TestTrackServerStart(t *testing.T) { |
| 539 | t.Parallel() |
| 540 | logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) |
| 541 | client := newClient(t.Context(), logger, true, true, "test-version") |
| 542 | |
| 543 | executed := false |
| 544 | cmdInfo := CommandInfo{ |
| 545 | Action: "mcp", |
| 546 | Args: []string{}, |
| 547 | Flags: []string{}, |
| 548 | } |
| 549 | err := client.TrackServerStart(t.Context(), cmdInfo, func(ctx context.Context) error { |
| 550 | executed = true |
| 551 | return nil |
| 552 | }) |
| 553 | require.NoError(t, err) |
| 554 | assert.True(t, executed) |
| 555 | } |
| 556 | |
| 557 | // TestGlobalTelemetryFunctions tests the global telemetry convenience functions |
| 558 | func TestGlobalTelemetryFunctions(t *testing.T) { |
nothing calls this directly
no test coverage detected