Skip to content

Commit 8b3f302

Browse files
fix(ci): build before Playwright preview server starts
Playwright plugin setup runs webServer before globalSetup, so CI vite preview returned 404 without dist/ and timed out. Add an explicit build step in the workflow and remove the late globalSetup.
1 parent 595dd3b commit 8b3f302

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
cache: npm
1717
- run: npm ci
1818
- run: npx playwright install chromium
19+
- run: npm run build
1920
- run: npm run test
2021

2122
perf-gate:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ Notable changes to Lotus Engine. Newest entries first.
44

55
---
66

7+
## 2026-06-14 — CI fix: Playwright webServer build order
8+
9+
### Fixed
10+
- GitHub Actions `build-test` — Playwright starts `webServer` before `globalSetup`, so `vite preview` served 404 without `dist/` and timed out after 120s
11+
- `playwright.config.ts` — build before preview locally; CI relies on workflow `npm run build` step; timeout raised to 300s in CI
12+
- `.github/workflows/ci.yml` — explicit `npm run build` before tests
13+
14+
### Removed
15+
- `tests/global-setup.ts` — redundant; ran too late to help webServer startup
16+
17+
### Verification
18+
```bash
19+
CI=1 npm run build && CI=1 npm run test # 519 passed
20+
```
21+
22+
---
23+
724
## 2026-06-14 — Public GitHub release
825

926
### Added

playwright.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ export default defineConfig({
2828
use: { ...devices['Desktop Chrome'] },
2929
},
3030
],
31-
globalSetup: './tests/global-setup.ts',
3231
webServer: {
33-
command: `npm run preview -- --host ${HOST} --port ${PORT}`,
32+
// Playwright starts webServer before globalSetup would run; local runs build here, CI builds in workflow.
33+
command: process.env.CI
34+
? `npm run preview -- --host ${HOST} --port ${PORT}`
35+
: `npm run build && npm run preview -- --host ${HOST} --port ${PORT}`,
3436
url: BASE_URL,
3537
reuseExistingServer: !process.env.CI,
36-
timeout: 120_000,
38+
timeout: process.env.CI ? 300_000 : 180_000,
3739
},
3840
})

0 commit comments

Comments
 (0)