MCPcopy Create free account
hub / github.com/github/gh-aw / TestNewErrorCollector

Function TestNewErrorCollector

pkg/workflow/error_aggregation_test.go:22–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestNewErrorCollector(t *testing.T) {
23 tests := []struct {
24 name string
25 failFast bool
26 }{
27 {
28 name: "fail-fast enabled",
29 failFast: true,
30 },
31 {
32 name: "fail-fast disabled",
33 failFast: false,
34 },
35 }
36
37 for _, tt := range tests {
38 t.Run(tt.name, func(t *testing.T) {
39 collector := NewErrorCollector(tt.failFast)
40 require.NotNil(t, collector, "Collector should be created")
41 assert.Equal(t, tt.failFast, collector.failFast, "Fail-fast setting should match")
42 assert.Equal(t, 0, collector.Count(), "New collector should have no errors")
43 assert.Equal(t, 0, collector.Count(), "New collector should have zero count")
44 })
45 }
46}
47
48func TestErrorCollectorAdd_FailFast(t *testing.T) {
49 collector := NewErrorCollector(true)

Callers

nothing calls this directly

Calls 3

CountMethod · 0.95
NewErrorCollectorFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected