MCPcopy Index your code
hub / github.com/coder/coder / TestRunMaxFailuresAddsOmittedLine

Function TestRunMaxFailuresAddsOmittedLine

scripts/gotestsummary/main_test.go:126–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

124}
125
126func TestRunMaxFailuresAddsOmittedLine(t *testing.T) {
127 t.Parallel()
128
129 jsonFile := writeEvents(t,
130 testEvent{Action: "fail", Package: "example.com/pkg", Test: "TestA", Elapsed: 0.10},
131 testEvent{Action: "fail", Package: "example.com/pkg", Test: "TestB", Elapsed: 0.20},
132 )
133
134 markdown := runMarkdown(t, jsonFile, config{
135 MaxOutputBytes: 8192,
136 MaxFailures: 1,
137 FailuresOut: filepath.Join(t.TempDir(), "failures.ndjson"),
138 })
139 require.Contains(t, markdown, "TestA")
140 require.NotContains(t, markdown, "<code>TestB</code>")
141 require.Contains(t, markdown, "_... and 1 more failed tests omitted. Download the failures-only artifact for the full list._")
142}
143
144func TestWriteFailuresNDJSONAppliesCap(t *testing.T) {
145 t.Parallel()

Callers

nothing calls this directly

Calls 4

writeEventsFunction · 0.85
runMarkdownFunction · 0.85
TempDirMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected