MCPcopy Create free account
hub / github.com/cli/cli / TestNoOpService

Function TestNoOpService

internal/telemetry/telemetry_test.go:523–533  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

521}
522
523func TestNoOpService(t *testing.T) {
524 service := &NoOpService{}
525 // All methods should be safe to call without panicking
526 service.Record(ghtelemetry.Event{Type: "test"})
527 event := service.Begin(ghtelemetry.Event{Type: "pending"})
528 event.UpsertDimensions(ghtelemetry.Dimensions{"key": "value"})
529 event.UpsertMeasures(ghtelemetry.Measures{"count": 1})
530 service.Disable()
531 service.SetSampleRate(50)
532 service.Finish()
533}
534
535func TestSpawnSendTelemetryRejectsOversizedPayload(t *testing.T) {
536 // Build a payload larger than maxPayloadSize (16KB)

Callers

nothing calls this directly

Calls 7

RecordMethod · 0.95
BeginMethod · 0.95
DisableMethod · 0.95
SetSampleRateMethod · 0.95
FinishMethod · 0.95
UpsertDimensionsMethod · 0.65
UpsertMeasuresMethod · 0.65

Tested by

no test coverage detected