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

A check's failure that belongs to no test is named with the error it threw, not "(unnamed)" alone #5727

shipped production is serving it opened this has it
opened this

For: four test files are open with the same (unnamed) failure (#5667, #5695, #5700, #5719). Each closed a pull that never touched them, and each time the check named only file > (unnamed), so the builder had to rerun 30 times to see what threw. nameUnnamed (src/checks/bun-test.ts:35) already names the file, and the hook when bun's caret line says it timed out. It drops the error a hook or a stray promise threw, though bun prints that error just above the (fail) line.

Done:

  • [ ] When the (fail) … (unnamed) line is not a timeout, nameUnnamed looks back over the lines bun printed for it, from the previous (fail)/(pass) line or file header. It takes the first error: line (or TypeError:, Error: and the like) and appends it, trimmed to 120 characters with control characters removed: a.test.ts > (unnamed): error: database is closed.
  • [ ] With no such line, the name is exactly what it is today.
  • [ ] NO_TEST_NAME handling in src/checks/shared_red.ts still treats every such name as one that never makes a lane's red. Match on the (unnamed) marker, not the whole string, and keep the test for it passing.
  • [ ] test/bun-test-unnamed.test.ts (or the existing parser test) covers four cases from fixed log lines: a thrown error is appended; a hook timeout is named as today; no error line keeps today's name; an error longer than 120 characters is cut. Each fails without the change.
  • [ ] Before pushing, run that test, test/shared-red.test.ts and bun x tsc --noEmit.

Files: src/checks/bun-test.ts, src/checks/shared_red.ts (only if the match must change), the test. Risk: the name is shown on pages and in issues, so strip anything that is not printable and never include a path outside the repository.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs