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

Function TestRunPassingInputWritesNoMarkdown

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

Source from the content-addressed store, hash-verified

33}
34
35func TestRunPassingInputWritesNoMarkdown(t *testing.T) {
36 t.Parallel()
37
38 jsonFile := writeEvents(t,
39 testEvent{Action: "output", Package: "example.com/pkg", Test: "TestOK", Output: "ok\n"},
40 testEvent{Action: "pass", Package: "example.com/pkg", Test: "TestOK", Elapsed: 0.01},
41 testEvent{Action: "pass", Package: "example.com/pkg", Elapsed: 0.02},
42 )
43 failuresFile := filepath.Join(t.TempDir(), "failures.ndjson")
44
45 var stdout bytes.Buffer
46 err := run(context.Background(), config{
47 JSONFile: jsonFile,
48 MarkdownOut: "-",
49 FailuresOut: failuresFile,
50 MaxOutputBytes: 8192,
51 }, &stdout, ioDiscard{}, emptyEnv)
52 require.NoError(t, err)
53 require.Empty(t, stdout.String())
54 assertFileContent(t, failuresFile, "")
55}
56
57func TestRunSingleFailureRendersBoundedOutput(t *testing.T) {
58 t.Parallel()

Callers

nothing calls this directly

Calls 6

writeEventsFunction · 0.85
assertFileContentFunction · 0.85
runFunction · 0.70
TempDirMethod · 0.65
EmptyMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected