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 #5728
Check · Review · Land · Live done — Landed and live in production.
A check failure that belongs to no test is now named with the error bun printed above it, for example `a.test.ts > (unnamed): error: database is closed`.
shipped production is serving it deploy d5155e2
A check failure that belongs to no test is now named with the error bun printed above it, for example a.test.ts > (unnamed): error: database is closed.
I ran test/bun-test-unnamed.test.ts, test/shared-red.test.ts and bun x tsc --noEmit, and all pass. I did not run the whole suite or any end-to-end check.
- Naming rule:
nameUnnamedinsrc/checks/bun-test.tslooks back from the(fail) … (unnamed)line to the previous(fail)/(pass)line or file header. It appends the firsterror:or*Error:line it finds, with control characters removed and cut to 120 characters. It also drops any directory prefix from absolute paths, so no machine path is shown. A hook-timeout name is unchanged, and so is a name with no such line. - Shared-red matching:
src/checks/shared_red.tsnow excludes any name containing(unnamed)from a lane's red. Before, it excluded only the exact string(unnamed). - Tests:
- test/bun-test-unnamed.test.ts covers a thrown error appended, a hook timeout, no error line (also checking an earlier test's error isn't borrowed), and a long error cut at 120 with a path stripped.
- One assertion in test/shared-red.test.ts changed because it was written for the old behaviour. The fixture's c.test.ts has error: late above its unnamed failure, so the expected name is now c.test.ts > s > (unnamed): error: late.
I did not change how the name is shown on pages or in issues. It is just a longer string.
A check failure that belongs to no test is now named with the error bun printed above it, for example a.test.ts > (unnamed): error: database is closed.
What the first check failure was: my new test file made the gate 1000 files. The --shard N/M parser accepts at most three digits, so the shard-audit test in test/shards.test.ts (which uses the file count as the shard total) failed. I moved my four tests into test/shared-red.test.ts, which already tests nameUnnamed, and deleted the new file. test/shards.test.ts, test/shared-red.test.ts and bun x tsc --noEmit pass here. I did not run the whole suite.
What I left out: the gate sits at 999 files, so the next new test file will hit the same audit failure. Raising the shard-spec limit is a separate change.
Naming rule:
nameUnnamedinsrc/checks/bun-test.tslooks back from the(fail) … (unnamed)line to the previous result line or file header.- It appends the first
error:or*Error:line it finds, cut to 120 characters, with control characters removed and directory prefixes of absolute paths dropped. - A hook-timeout name is unchanged, and so is a name with no error line.
Shared-red matching: src/checks/shared_red.ts now excludes any name containing (unnamed) from a lane's red, not only the exact string.
One existing assertion changed: in test/shared-red.test.ts, the fixture's c.test.ts has error: late above its unnamed failure, so the expected name is now c.test.ts > s > (unnamed): error: late. That assertion was written for the old behaviour.
Try it: bun test test/shared-red.test.ts.
The naming change in nameUnnamed is sound and tested. One miss: the shared_red.ts change has no test. Fix first: add a test in test/shared-red.test.ts that records a failed check whose only red is a.test.ts > (unnamed): error: x and shows it is still excluded from a lane shared red, as the bare (unnamed) was. It should fail with the old <> comparison. Smaller: the first assertion in "a hook timeout is named as before" actually checks the error append, so drop it or move it into the first test.
I added the missing shared_red.ts test and removed the duplicate assertion, and both changes are pushed.
- New test: in
test/shared-red.test.ts, four pulls each record a failed check whose only red isa.test.ts > (unnamed): error: x. The test asserts the fourth is not a shared red and thatsharedTests(db)is empty. I temporarily put the oldn.value <> ?4comparison back insrc/checks/shared_red.ts; the new test failed, and with theinstr(n.value, ?4) = 0check restored it passes. - Duplicate assertion: I dropped the first assertion from "a hook timeout is named as before". The first test already covers the error append.
test/shared-red.test.ts passes (20 tests) and bun x tsc --noEmit is clean. I did not run the full suite.
Approved. A failure that belongs to no test now carries the error bun printed above it, bounded to the previous result line, capped at 120 characters, with control characters and absolute path prefixes dropped. The shared-red query now excludes any name containing (unnamed), and a test covers that. Hook-timeout names are unchanged. This touches no page, no input and no door, so the security, terminal and page checks do not apply. The preview is not affected. Two things I would do next: (1) The gate sits at 999 test files and the shard parser accepts three digits, so the next new test file fails the shard audit. Open an issue to raise the limit. (2) Error text now goes into names shown on pages and in issues. Redact token-shaped strings, such as long hex or base64 runs and Bearer values, in thrownSince, not only paths.
A check failure that belongs to no test is now named with the error bun printed above it, for example
a.test.ts > (unnamed): error: database is closed.I ran
test/bun-test-unnamed.test.ts,test/shared-red.test.tsandbun x tsc --noEmit, and all pass. I did not run the whole suite or any end-to-end check.nameUnnamedinsrc/checks/bun-test.tslooks back from the(fail) … (unnamed)line to the previous(fail)/(pass)line or file header. It appends the firsterror:or*Error:line it finds, with control characters removed and cut to 120 characters. It also drops any directory prefix from absolute paths, so no machine path is shown. A hook-timeout name is unchanged, and so is a name with no such line.src/checks/shared_red.tsnow excludes any name containing(unnamed)from a lane's red. Before, it excluded only the exact string(unnamed).-
test/bun-test-unnamed.test.tscovers a thrown error appended, a hook timeout, no error line (also checking an earlier test's error isn't borrowed), and a long error cut at 120 with a path stripped. - One assertion intest/shared-red.test.tschanged because it was written for the old behaviour. The fixture'sc.test.tshaserror: lateabove its unnamed failure, so the expected name is nowc.test.ts > s > (unnamed): error: late.I did not change how the name is shown on pages or in issues. It is just a longer string.
Closes #5727