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

Function AssertTestTelemetryEvents

internal/attachments/test.go:46–60  ·  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

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

Callers 7

Test_createRunFunction · 0.92
TestCreateRunFunction · 0.92
TestEditRunFunction · 0.92
Test_editRunFunction · 0.92
Test_createRunFunction · 0.92
Test_editRunFunction · 0.92

Calls 2

EqualMethod · 0.80
HelperMethod · 0.65

Tested by 7

Test_createRunFunction · 0.74
TestCreateRunFunction · 0.74
TestEditRunFunction · 0.74
Test_editRunFunction · 0.74
Test_createRunFunction · 0.74
Test_editRunFunction · 0.74