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

Function AssertTestTelemetryEvents

internal/attachments/test.go:44–58  ·  view source on GitHub ↗

AssertTestTelemetryEvents verifies the completed invocation event shape.

(t *testing.T, events []ghtelemetry.Event, attachCount int, result UploadResult)

Source from the content-addressed store, hash-verified

42
43// AssertTestTelemetryEvents verifies the completed invocation event shape.
44func AssertTestTelemetryEvents(t *testing.T, events []ghtelemetry.Event, attachCount int, result UploadResult) {
45 t.Helper()
46
47 require.Equal(t, []ghtelemetry.Event{
48 {
49 Type: "attachment_invocation",
50 Dimensions: ghtelemetry.Dimensions{"command": "gh test"},
51 Measures: ghtelemetry.Measures{
52 "attach_count": int64(attachCount),
53 "append_ops_count": int64(result.AppendOperations),
54 "replace_ops_count": int64(result.ReplaceOperations),
55 },
56 },
57 }, events)
58}
59
60// StubUpload registers one upload of name against repositoryID, answering with
61// status and body.

Callers 5

Test_createRunFunction · 0.92
Test_editRunFunction · 0.92
Test_createRunFunction · 0.92
Test_editRunFunction · 0.92

Calls 2

EqualMethod · 0.80
HelperMethod · 0.65

Tested by 5

Test_createRunFunction · 0.74
Test_editRunFunction · 0.74
Test_createRunFunction · 0.74
Test_editRunFunction · 0.74