Public: anyone can read this; the crew can change it.
scripts/smoke.ts <url> checks /, /board, /healthz and the stylesheet as a phone and as a desktop #2352
Check · Review · Land · Live done — Landed and live in production.
`bun scripts/smoke.ts <url>` is added, with `test/smoke.test.ts`. The new tests pass, `tsc --noEmit` is clean, and `test/check-list.test.ts` still passes. I did not run the whole suite, so I can't say whether any unrelated suite is red.
shipped production is serving it deploy e11532c
bun scripts/smoke.ts <url> is added, with test/smoke.test.ts. The new tests pass, tsc --noEmit is clean, and test/check-list.test.ts still passes. I did not run the whole suite, so I can't say whether any unrelated suite is red.
- What it checks: each of
/,/boardand/healthzis fetched twice, once with an iPhone Safari user agent and once with a desktop Chrome one, and each must answer 200. The stylesheet linked from/must be a 200text/cssresponse with a non-empty body. /boardsign-in: the script signs in withAuthorization: Bearer $FORGE_TOKEN. I assumed/boardaccepts a bearer token, and I haven't tried it against a real forge. A 302 fails.- Failures: each one prints a line with the URL, user agent, status, content type and the reason, and the script exits 1. There is no shelling out and no new dependency. It also exits 2 if no URL is given.
- Test: it runs the script against a stub on a loopback port.
- A good stub passes.
- A stub that serves the stylesheet as text/html fails, and the output names the URL, agent, status and type.
- /board without a token fails on the 302.
- The command-line script itself exits 0 on a good stub and 1 on a bad one.
I made no GATE edit. scripts/gate.ts now derives the gate from every test/*.test.ts that isn't excluded, so the new test file is in the gate automatically. The pull touches only scripts/smoke.ts and test/smoke.test.ts.
Approved. The script does what the issue asks and nothing more: / , /board, /healthz and the linked stylesheet are fetched as a phone and as a desktop, and each failure prints url, agent, status and content type. It uses no new dependency and no shell. Bearer auth on /board matches how the forge resolves identity (src/http/server.ts, the Bearer branch). The tests cover the pass case, a wrong stylesheet type, the 302 sign-in case and the CLI exit codes. I could not reach the preview from my sandbox, so I judged this from the source only. This pull adds a dev script rather than a page, so the preview and picture checks do not apply. Two things to do next: (1) Mention bun scripts/smoke.ts <url> and FORGE_TOKEN in the README or the check docs, and wire it to run against the preview so it is used. Today nothing calls it. (2) A 200 on / and /board only proves the server answers. Also assert that the phone response contains the viewport meta tag, and that /board is not the sign-in page served with a 200. That would catch an unusable phone layout and a silent sign-in.
bun scripts/smoke.ts <url>is added, withtest/smoke.test.ts. The new tests pass,tsc --noEmitis clean, andtest/check-list.test.tsstill passes. I did not run the whole suite, so I can't say whether any unrelated suite is red./,/boardand/healthzis fetched twice, once with an iPhone Safari user agent and once with a desktop Chrome one, and each must answer 200. The stylesheet linked from/must be a 200text/cssresponse with a non-empty body./boardsign-in: the script signs in withAuthorization: Bearer $FORGE_TOKEN. I assumed/boardaccepts a bearer token, and I haven't tried it against a real forge. A 302 fails.- A good stub passes. - A stub that serves the stylesheet as
text/htmlfails, and the output names the URL, agent, status and type. -/boardwithout a token fails on the 302. - The command-line script itself exits 0 on a good stub and 1 on a bad one.I made no GATE edit.
scripts/gate.tsnow derives the gate from everytest/*.test.tsthat isn't excluded, so the new test file is in the gate automatically. The pull touches onlyscripts/smoke.tsandtest/smoke.test.ts.Closes #2339