Skip to content

Commit 974281a

Browse files
bloveclaude
andauthored
Gate on the dev build, not just the production one (#387)
* ci(website): gate on the dev build, not just the production one Closes the follow-up left open by #385. Every website spec runs against `next start`. A production build does not double-invoke effects, so nothing in CI ever exercised the build a contributor opens — which is how a homepage that rendered NO grid under StrictMode survived from #321 to #383 with the suite 100/100 green the entire time. The `dev-smoke` job starts a real `next dev` and runs `dev-mode.spec.ts` against it. It builds the packages first, because the website imports them from `dist` and a dev server is only as honest as the last build. The spec skipped itself when `PRETABLE_DEV_URL` was unset, which is right locally and would be a disaster as a gate: a job that reports success for running nothing is the same silence this spec exists to end. In CI the variable is the job's responsibility, so its absence now fails with the reason instead of skipping. Verified both directions — `CI=1` without the URL fails, a local run without it still skips. On failure the job keeps the dev server's own log, not just the trace: a compile error reaches Playwright as a blank page, and the log is where it says why. Verified by running the job's exact sequence locally — build, start, wait, smoke — 2 passed against a real dev server. Note this narrows the blind spot rather than removing it: the job runs one browser against two pages. It catches lifecycle faults of the class that hid here, not everything a production-only suite misses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(ci): key the dev-smoke guard to the job, not to CI The anti-vacuum guard added in the previous commit keyed on `CI`, so it fired in every CI job that runs this directory — including the production and preview smokes, which have no dev server by design and legitimately skip these tests. It failed the required preview-smoke check twice on this PR's own first run. Keyed on `PRETABLE_DEV_SMOKE` instead, which only the dev-smoke job sets. The property that matters is unchanged: the one job whose purpose is smoking a dev server refuses to skip its way to green. Verified all three paths: whole-directory run under `CI` skips, dev-smoke intent without a URL fails, dev-smoke with a URL passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 77b12e4 commit 974281a

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,64 @@ jobs:
112112
- run: pnpm install --frozen-lockfile
113113
- run: pnpm build
114114

115+
dev-smoke:
116+
name: Dev build — grid renders under StrictMode
117+
runs-on: ubuntu-latest
118+
steps:
119+
- uses: actions/checkout@v7
120+
- uses: pnpm/action-setup@v6
121+
- uses: actions/setup-node@v7
122+
with:
123+
node-version: 22
124+
cache: pnpm
125+
- run: pnpm install --frozen-lockfile
126+
# The website imports the packages from `dist`, so a dev server is only
127+
# as honest as the last build.
128+
- run: pnpm build
129+
- run: pnpm exec playwright install --with-deps chromium
130+
# Every other website spec runs against `next start`. A production build
131+
# does not double-invoke effects, which is why a homepage that rendered NO
132+
# grid under StrictMode survived from #321 to #383 with the suite green.
133+
# This job is the one that runs the build a contributor actually sees.
134+
- name: Start the dev server
135+
run: |
136+
pnpm --filter @pretable/app-website exec next dev -p 3100 \
137+
> /tmp/next-dev.log 2>&1 &
138+
for i in $(seq 1 60); do
139+
if curl -sSf -o /dev/null http://localhost:3100/; then
140+
echo "dev server up after ${i}s"
141+
exit 0
142+
fi
143+
sleep 1
144+
done
145+
echo "dev server never responded"
146+
cat /tmp/next-dev.log
147+
exit 1
148+
- name: Smoke the dev build
149+
env:
150+
# Declares intent: with this set, the spec refuses to skip.
151+
PRETABLE_DEV_SMOKE: "1"
152+
PRETABLE_DEV_URL: http://localhost:3100
153+
run: |
154+
pnpm --filter @pretable/app-website exec playwright test \
155+
e2e/dev-mode.spec.ts --project=chromium
156+
# The dev server's own output carries the compile errors Playwright only
157+
# sees as a blank page, so it is worth more than the trace on a failure.
158+
- name: Upload dev server log on failure
159+
if: failure()
160+
uses: actions/upload-artifact@v7
161+
with:
162+
name: website-dev-server-log
163+
path: /tmp/next-dev.log
164+
retention-days: 7
165+
- name: Upload Playwright traces on failure
166+
if: failure()
167+
uses: actions/upload-artifact@v7
168+
with:
169+
name: website-dev-smoke-traces
170+
path: apps/website/test-results/
171+
retention-days: 7
172+
115173
packaging:
116174
name: Packaging — publint + attw
117175
runs-on: ubuntu-latest

‎apps/website/e2e/dev-mode.spec.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ import { waitForGridReady } from "./helpers";
2727
*/
2828
const devUrl = process.env.PRETABLE_DEV_URL;
2929

30+
// Skipping is convenience everywhere except the one job whose entire purpose is
31+
// running this: there, skipping would report success for checking nothing — the
32+
// same silence this spec exists to end, since the suite was 100/100 green
33+
// throughout the weeks the dev grid was blank.
34+
//
35+
// Keyed on the job's declared intent, NOT on `CI`. The production and preview
36+
// smokes run the whole directory and have no dev server by design; a `CI` guard
37+
// failed them both, which is its own kind of false alarm.
38+
if (process.env.PRETABLE_DEV_SMOKE && !devUrl) {
39+
test("the dev server URL is configured", () => {
40+
throw new Error(
41+
"PRETABLE_DEV_URL is unset in CI. The dev-smoke job must start a dev " +
42+
"server and point this at it; without it these tests skip and the " +
43+
"job goes green having checked nothing.",
44+
);
45+
});
46+
}
47+
3048
test.describe("development build", () => {
3149
test.skip(
3250
!devUrl,

0 commit comments

Comments
 (0)