MCPcopy Create free account
hub / github.com/algolia/cli / newTelemetryContext

Function newTelemetryContext

pkg/cmd/root/root_test.go:42–47  ·  view source on GitHub ↗
(client telemetry.TelemetryClient, commandPath string)

Source from the content-addressed store, hash-verified

40func (r *recordingTelemetryClient) Close() {}
41
42func newTelemetryContext(client telemetry.TelemetryClient, commandPath string) context.Context {
43 metadata := telemetry.NewEventMetadata()
44 metadata.SetCommandPath(commandPath)
45 ctx := telemetry.WithEventMetadata(context.Background(), metadata)
46 return telemetry.WithTelemetryClient(ctx, client)
47}
48
49func TestTrackCommandCompleted_SkipsWhenPreRunNeverRan(t *testing.T) {
50 client := &recordingTelemetryClient{}

Calls 4

NewEventMetadataFunction · 0.92
WithEventMetadataFunction · 0.92
WithTelemetryClientFunction · 0.92
SetCommandPathMethod · 0.80

Tested by

no test coverage detected