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

Full suite red: test/api-security-floor.test.ts #17965

opened this in answer to

Merged 17h 39m ago, live in production

I split the single GET/HEAD sweep in test/api-security-floor.test.ts into three tests, so each stays under the 2 s per-test CPU budget. I didn't re-measure the CPU time of the split tests; I only know they pass. What changed: the sweep was one test that asked every contract GET three ways.

Notes

opened this

I split the single GET/HEAD sweep in test/api-security-floor.test.ts into three tests, so each stays under the 2 s per-test CPU budget. I didn't re-measure the CPU time of the split tests; I only know they pass.

  • What changed: the sweep was one test that asked every contract GET three ways. It is now one test each for GET signed out, HEAD signed out, and GET signed in, sharing a small sweepGets helper.
  • Same coverage: the three tests make the same requests as the old one, and each checks the floor headers on every answer.
  • Status checks: signed-out GET still expects 200, 401 and 404 to be reached. Signed-in GET now expects only 200 and 404, since a signed-in request shouldn't get 401. HEAD expects none, because a HEAD has no body to tell a 200 from a refusal.
  • Left alone: I didn't add a SLOW entry in scripts/gate.ts. That list is for files that can't be made faster, and this one could be split.
  • Checks run:
    • The file's 9 tests pass.
    • bun x tsc --noEmit is clean.
    • bun scripts/gate.ts --fix changed nothing.
    • bun scripts/test-budget.ts test/api-security-floor.test.ts printed nothing, so I can't say it confirmed the budget.
  • Try it: bun test ./test/api-security-floor.test.ts. The forge's full-suite check will show whether each test now fits the budget under load.

🤖 Generated with Claude Code

Closes #17963

commented

I split the single GET/HEAD sweep in test/api-security-floor.test.ts into three tests, so each stays under the 2 s per-test CPU budget. I didn't re-measure the CPU time of the split tests; I only know they pass.

  • What changed: the sweep was one test that asked every contract GET three ways. It is now one test each for GET signed out, HEAD signed out, and GET signed in, sharing a small sweepGets helper.
  • Same coverage: the three tests make the same requests as the old one, and each checks the floor headers on every answer.
  • Status checks: signed-out GET still expects 200, 401 and 404 to be reached. Signed-in GET now expects only 200 and 404, since a signed-in request shouldn't get 401. HEAD expects none, because a HEAD has no body to tell a 200 from a refusal.
  • Left alone: I didn't add a SLOW entry in scripts/gate.ts. That list is for files that can't be made faster, and this one could be split.
  • Checks run:
    • The file's 9 tests pass.
    • bun x tsc --noEmit is clean.
    • bun scripts/gate.ts --fix changed nothing.
    • bun scripts/test-budget.ts test/api-security-floor.test.ts printed nothing, so I can't say it confirmed the budget.
  • Try it: bun test ./test/api-security-floor.test.ts. The forge's full-suite check will show whether each test now fits the budget under load.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs