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

Full suite red: test/traffic-truth.test.ts #17972

opened this in answer to

Merged 13h 51m ago, live in production

The slow test in test/traffic-truth.test.ts is faster now. The whole file runs in about 1.4 s, down from about 2.3 s. I ran it twice and it passed both times, and bun x tsc --noEmit is clean.

Notes

opened this

The slow test in test/traffic-truth.test.ts is faster now. The whole file runs in about 1.4 s, down from about 2.3 s. I ran it twice and it passed both times, and bun x tsc --noEmit is clean. I did not run the dead-code, process-wide-state, during or duplicate-import checks the issue lists, or the bun test rerun-each command from it, and I did not run bun scripts/design-lint.ts, since no web files changed.

The test minted its two tokens through POST /api/v1/tokens, which checks a password hash on every call. That hashing is where most of the 2.55 s of CPU went. The test now creates them directly with createToken from src/core/tokens.ts.

One assertion changed, and the old one was wrong. The old call asked for a scope named "read", which doesn't exist, so no token came back and the probe saw "Bearer undefined" and returned 404. A real read-only token for a non-admin gets 403 from the probe, so the test now expects 403. It is still checked that the probe, the board and the traffic page stay closed to non-admins.

No code under src/ changed. The commit message says No door: test-only change. and the gate's --fix rewrapped nothing that needed committing. I pushed the branch, and the forge will run the full check on that push.

To try it: bun test ./test/traffic-truth.test.ts

Closes #17970

commented

The slow test in test/traffic-truth.test.ts is faster now. The whole file runs in about 1.4 s, down from about 2.3 s. I ran it twice and it passed both times, and bun x tsc --noEmit is clean. I did not run the dead-code, process-wide-state, during or duplicate-import checks the issue lists, or the bun test rerun-each command from it, and I did not run bun scripts/design-lint.ts, since no web files changed.

The test minted its two tokens through POST /api/v1/tokens, which checks a password hash on every call. That hashing is where most of the 2.55 s of CPU went. The test now creates them directly with createToken from src/core/tokens.ts.

One assertion changed, and the old one was wrong. The old call asked for a scope named "read", which doesn't exist, so no token came back and the probe saw "Bearer undefined" and returned 404. A real read-only token for a non-admin gets 403 from the probe, so the test now expects 403. It is still checked that the probe, the board and the traffic page stay closed to non-admins.

No code under src/ changed. The commit message says No door: test-only change. and the gate's --fix rewrapped nothing that needed committing. I pushed the branch, and the forge will run the full check on that push.

To try it: bun test ./test/traffic-truth.test.ts

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs