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

Function TestRunSingleFailureRendersBoundedOutput

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

Source from the content-addressed store, hash-verified

55}
56
57func TestRunSingleFailureRendersBoundedOutput(t *testing.T) {
58 t.Parallel()
59
60 jsonFile := writeEvents(t,
61 testEvent{Action: "output", Package: "example.com/pkg", Test: "TestFail", Output: "prefix-" + strings.Repeat("x", 20)},
62 testEvent{Action: "fail", Package: "example.com/pkg", Test: "TestFail", Elapsed: 1.25},
63 testEvent{Action: "fail", Package: "example.com/pkg", Elapsed: 1.50},
64 )
65
66 markdown := runMarkdown(t, jsonFile, config{MaxOutputBytes: 10})
67 require.Contains(t, markdown, "## Go test failures (2 in 1 packages)")
68 require.Contains(t, markdown, "| example.com/pkg | TestFail | 1.25s |")
69 require.NotContains(t, markdown, "prefix")
70 require.Contains(t, markdown, strings.Repeat("x", 10))
71}
72
73func TestRunSubtestFailureCapturesSlashName(t *testing.T) {
74 t.Parallel()

Callers

nothing calls this directly

Calls 3

writeEventsFunction · 0.85
runMarkdownFunction · 0.85
ContainsMethod · 0.45

Tested by

no test coverage detected