You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,18 +170,48 @@ Anti-patterns: `grep -r` across repo when codegraph answers; reading 5+ files to
170
170
171
171
Every feature/fix ships with a Playwright spec in `tests/e2e/`. Write the spec, but **do NOT run E2E tests locally** — they require a running wrangler dev server, consume excessive memory, and are validated by CI on PR. Running them locally is too expensive.
172
172
173
+
### CI test selection strategy (dynamic)
174
+
175
+
CI runs **smoke tests + tests tagged to changed areas only** — not the full suite. This keeps PR feedback fast.
176
+
177
+
**Tag every test** with `@smoke` (critical path, always runs) or a feature tag (`@media`, `@content`, `@auth`, `@api-keys`, `@database`, `@collections`, etc.):
CI invocation: `npx playwright test --grep "@smoke|@<detected-tag>"`.
199
+
200
+
**When writing a new spec**: choose the tightest matching feature tag. If it spans multiple features, use the primary one + `@smoke` if it tests login/nav/core flow.
201
+
173
202
Workflow:
174
203
1. Implement
175
204
2. Add `tests/e2e/<NN>-<slug>.spec.ts` (NN = next sequential; current floor 68 — R11)
176
-
3. Commit implementation + tests together — CI runs E2E
205
+
3. Tag tests with `@smoke` and/or appropriate feature tag
206
+
4. Commit implementation + tests together — CI selects and runs relevant tests
test.describe('Feature Name @feature-tag', () => {
185
215
test.beforeEach(async ({ page }) => {
186
216
awaitloginAsAdmin(page)
187
217
})
@@ -216,6 +246,12 @@ cd packages/core && npm run generate:migrations
216
246
217
247
After **any**`packages/core/migrations/*.sql` change: regenerate the bundle, re-sync `my-sonicjs-app/migrations/`, commit the regenerated `migrations-bundle.ts` (R9).
218
248
249
+
**Lock file trap (macOS → Linux CI):** Any `npm install` on macOS regenerates `package-lock.json` without Linux optional packages (`@emnapi/runtime`, `@emnapi/core`, `wrangler/node_modules/esbuild`), breaking `npm ci` in CI. After any `npm install` that touches `package-lock.json`, immediately run a full delete-and-reinstall to restore cross-platform entries:
Then commit the regenerated `package-lock.json`. Never commit a lock file produced by `npm install --workspace=...` directly.
254
+
219
255
D1's **100 bound params/statement** and **100 columns/table** limits do not reproduce on local SQLite — cover with logic unit tests (chunk counts, column budget).
0 commit comments