Fix setup project: override testDir so global.setup.ts is discovered #1

Merged
peptiderepo merged 1 commits from claude/setup-project-testdir-fix-20260514 into main 2026-05-14 09:40:31 +00:00
peptiderepo commented 2026-05-14 09:31:16 +00:00 (Migrated from github.com)

Summary

  • The top-level testDir: './tests' scopes Playwright's file discovery. global.setup.ts lives at the repo root, so the setup project's testMatch: /global\.setup\.ts/ never matched - Playwright silently ran 0 setup tests.
  • Result: playwright/.auth/admin.json was never written, and every dependent test failed on storageState load with ENOENT.
  • Fix: add testDir: '.' to the setup project. Scoped per-project, so the chromium project still uses the top-level ./tests testDir.

Impact

Bug has been silently blocking PRAutoBlogger's workflow-driven prod deploys since the smoke gate was added on 2026-04-26. v0.14.0 and v0.15.0 reached prod via manual SSH rsync. PR peptiderepo/prautoblogger#142 (v0.15.1) is currently held on staging waiting for this fix.

Test plan

  • Merge to main
  • Re-run the failed Deploy PRAutoBlogger to Hostinger job on prautoblogger SHA 1955f928
  • Confirm Running 22 tests using 1 worker (1 setup + 21 smoke) instead of 21 tests
  • Confirm playwright/.auth/admin.json is written
  • Confirm smoke gate passes, production deploy promotes

Diagnosis evidence

Smoke log on the prautoblogger v0.15.1 run shows Running 21 tests using 1 worker - setup project contributed zero tests. Every failure has the identical error ENOENT: 'playwright/.auth/admin.json'. The auth flow itself (credentials, login form selectors) was never exercised - it can't have failed because it never ran.

  • CTO
## Summary - The top-level `testDir: './tests'` scopes Playwright's file discovery. `global.setup.ts` lives at the repo root, so the setup project's `testMatch: /global\.setup\.ts/` never matched - Playwright silently ran 0 setup tests. - Result: `playwright/.auth/admin.json` was never written, and every dependent test failed on storageState load with `ENOENT`. - Fix: add `testDir: '.'` to the setup project. Scoped per-project, so the chromium project still uses the top-level `./tests` testDir. ## Impact Bug has been silently blocking PRAutoBlogger's workflow-driven prod deploys since the smoke gate was added on 2026-04-26. v0.14.0 and v0.15.0 reached prod via manual SSH rsync. PR [peptiderepo/prautoblogger#142](https://github.com/peptiderepo/prautoblogger/pull/142) (v0.15.1) is currently held on staging waiting for this fix. ## Test plan - [ ] Merge to main - [ ] Re-run the failed `Deploy PRAutoBlogger to Hostinger` job on prautoblogger SHA `1955f928` - [ ] Confirm `Running 22 tests using 1 worker` (1 setup + 21 smoke) instead of `21 tests` - [ ] Confirm `playwright/.auth/admin.json` is written - [ ] Confirm smoke gate passes, production deploy promotes ## Diagnosis evidence Smoke log on the prautoblogger v0.15.1 run shows `Running 21 tests using 1 worker` - setup project contributed zero tests. Every failure has the identical error ``ENOENT: 'playwright/.auth/admin.json'``. The auth flow itself (credentials, login form selectors) was never exercised - it can't have failed because it never ran. - CTO
Sign in to join this conversation.