Public: anyone can read this; the crew can change it.

A full-suite red report quotes the failing assertion and the lines around it, and says how to reproduce it #12304

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Full-suite red reports now quote the failure and say how to reproduce it. Each issue the report files, and each "Still red" comment, carries every quoted test's `error:` line and up to 30 lines of its output, cut from the run's own log. It ends with the commands to run the file again and the shard and concurrency the suite ran it under.

shipped production is serving it deploy 97489a2

opened this

Full-suite red reports now quote the failure and say how to reproduce it. Each issue the report files, and each "Still red" comment, carries every quoted test's error: line and up to 30 lines of its output, cut from the run's own log. It ends with the commands to run the file again and the shard and concurrency the suite ran it under.

  • Capturing (redDetail in src/checks/report.ts): while the log is still available, it records each failing test's error: line and an excerpt: a few lines of bun's source context before the error, up to EXCERPT_LINES (30) in total. It also records the file's shard from the ── shard N/M line, the files beside it in that shard, and the concurrency from the test-shards: banner. These are stored in the run's CheckDetail; src/core/runs.ts gains optional assertion, excerpt, shards and concurrency fields.
  • Size limits: lines are cut at 200 characters, at most 3 tests per file and 10 per run are quoted, and the text kept for any one test is bounded however much it prints. A 10,000-line output therefore makes an issue of a few kilobytes, and the error: line is kept even when thousands of lines follow it.
  • Escaping: colour codes and control characters are stripped. The excerpt sits in a fenced block whose fence is longer than any run of backticks inside it, so nothing in the log can close the block.
  • Rendering (redBody): the reproduce section gives bun test ./<file> and bun test ./<file> --rerun-each 10. When the file shared its shard with others it adds bun test over that shard's files, and it states the shard and concurrency, or says the log didn't name a shard. The paths are prefixed ./ as scripts/test-shards.ts does, so bun runs that exact file rather than every path that contains the name.
  • Choices: a failing test that printed nothing is named but not quoted, since an excerpt of only its (fail) line says nothing. This also keeps the existing test/check-verify.test.ts assertion unchanged. The --rerun-each 10 flag lives once in report.ts as RERUN: test/flake.test.ts refuses any test file in the gate that contains a retry flag, even inside an expected string.

Tests: six new tests in test/full-suite-report.test.ts. Excerpt and assertion, including log text with HTML and triple backticks, must stay inside the fence. The filed issue must carry the commands, shard and concurrency, and so must each "Still red" comment. A 10,000-line log must be cut to the limit with its error: line kept. A test that printed nothing gets no excerpt, and a log with no shard banner says so. They fail without the excerpt or the commands.

bun scripts/gate.ts and bun x tsc --noEmit are clean. The change reaches too many tests for fast.ts to list, so I ran the suites that read the report, check details and flakes (full-suite-report, check-verify, flake*, cli-sync, home-flow, public-head, release-prove, render-junit, snapshot-store, webhook-failing): 177 pass.

The first commit (5b8d4df37) was pushed red: one new test was wrong, and the gate refused comment lines over 100 columns. The next two commits fix both. The issue's plan was not kept: the keep_plan tool wasn't available in this session.

🤖 Generated with Claude Code

Closes #12295

commented

Full-suite red reports now quote the failure and say how to reproduce it. Each issue the report files, and each "Still red" comment, carries every quoted test's error: line and up to 30 lines of its output, cut from the run's own log. It ends with the commands to run the file again and the shard and concurrency the suite ran it under.

  • Capturing (redDetail in src/checks/report.ts): while the log is still available, it records each failing test's error: line and an excerpt: a few lines of bun's source context before the error, up to EXCERPT_LINES (30) in total. It also records the file's shard from the ── shard N/M line, the files beside it in that shard, and the concurrency from the test-shards: banner. These are stored in the run's CheckDetail; src/core/runs.ts gains optional assertion, excerpt, shards and concurrency fields.
  • Size limits: lines are cut at 200 characters, at most 3 tests per file and 10 per run are quoted, and the text kept for any one test is bounded however much it prints. A 10,000-line output therefore makes an issue of a few kilobytes, and the error: line is kept even when thousands of lines follow it.
  • Escaping: colour codes and control characters are stripped. The excerpt sits in a fenced block whose fence is longer than any run of backticks inside it, so nothing in the log can close the block.
  • Rendering (redBody): the reproduce section gives bun test ./<file> and bun test ./<file> --rerun-each 10. When the file shared its shard with others it adds bun test over that shard's files, and it states the shard and concurrency, or says the log didn't name a shard. The paths are prefixed ./ as scripts/test-shards.ts does, so bun runs that exact file rather than every path that contains the name.
  • Choices: a failing test that printed nothing is named but not quoted, since an excerpt of only its (fail) line says nothing. This also keeps the existing test/check-verify.test.ts assertion unchanged. The --rerun-each 10 flag lives once in report.ts as RERUN: test/flake.test.ts refuses any test file in the gate that contains a retry flag, even inside an expected string.

Tests: six new tests in test/full-suite-report.test.ts. Excerpt and assertion, including log text with HTML and triple backticks, must stay inside the fence. The filed issue must carry the commands, shard and concurrency, and so must each "Still red" comment. A 10,000-line log must be cut to the limit with its error: line kept. A test that printed nothing gets no excerpt, and a log with no shard banner says so. They fail without the excerpt or the commands.

bun scripts/gate.ts and bun x tsc --noEmit are clean. The change reaches too many tests for fast.ts to list, so I ran the suites that read the report, check details and flakes (full-suite-report, check-verify, flake*, cli-sync, home-flow, public-head, release-prove, render-junit, snapshot-store, webhook-failing): 177 pass.

The first commit (5b8d4df37) was pushed red: one new test was wrong, and the gate refused comment lines over 100 columns. The next two commits fix both. The issue's plan was not kept: the keep_plan tool wasn't available in this session.

🤖 Generated with Claude Code

Approved

Reads right against the issue: the excerpt, the assertion, the fenced block, the reproduce commands, the shard and concurrency, and a hard line cap. It is a pipeline item (red reports become actionable) and adds no feature surface, so no TUI screen or docs/features page is needed, and README is untouched. No new dependency, escaping is sound (control and ANSI stripped, fence longer than any backtick run, inline spans likewise). The report only appears after a real full-suite red, so I judged it from the diff and its six tests, not from the preview.

Two things I would do next:

  1. Fold inline into fence (both compute the longest backtick run) and put the helper before its first use.
  2. The bound is 30 lines x 200 columns x 3 tests per file, which is about 18 KB per issue, not the few kilobytes the pull text claims. Lower QUOTED_PER_FILE or LINE_MAX, or state the real bound, and add a test on a file with three huge failures.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs