MCPcopy
hub / github.com/docker/docker-agent / TestTrackServerStart

Function TestTrackServerStart

pkg/telemetry/telemetry_test.go:538–555  ·  view source on GitHub ↗

TestTrackServerStart tests long-running server command tracking

(t *testing.T)

Source from the content-addressed store, hash-verified

536
537// TestTrackServerStart tests long-running server command tracking
538func 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
558func TestGlobalTelemetryFunctions(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newClientFunction · 0.85
ContextMethod · 0.80
TrackServerStartMethod · 0.80
NewMethod · 0.45

Tested by

no test coverage detected