fix: harden e2e server readiness
This commit is contained in:
@@ -12,7 +12,7 @@ if (!process.env.CI) {
|
|||||||
const API_PORT = process.env.API_PORT ?? '3001';
|
const API_PORT = process.env.API_PORT ?? '3001';
|
||||||
const WEB_PORT = process.env.WEB_PORT ?? '3000';
|
const WEB_PORT = process.env.WEB_PORT ?? '3000';
|
||||||
|
|
||||||
const SERVER_STARTUP_TIMEOUT_MS = process.env.CI ? 180_000 : 60_000;
|
const SERVER_STARTUP_TIMEOUT_MS = process.env.CI ? 300_000 : 60_000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Playwright E2E configuration for Goodgo Platform.
|
* Playwright E2E configuration for Goodgo Platform.
|
||||||
@@ -91,10 +91,12 @@ export default defineConfig({
|
|||||||
|
|
||||||
webServer: [
|
webServer: [
|
||||||
{
|
{
|
||||||
|
name: 'GoodGo API',
|
||||||
command: `PORT=${API_PORT} pnpm --filter @goodgo/api run dev`,
|
command: `PORT=${API_PORT} pnpm --filter @goodgo/api run dev`,
|
||||||
url: `http://localhost:${API_PORT}/api/v1/docs`,
|
port: Number(API_PORT),
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
timeout: SERVER_STARTUP_TIMEOUT_MS,
|
timeout: SERVER_STARTUP_TIMEOUT_MS,
|
||||||
|
stdout: process.env.CI ? 'pipe' : 'ignore',
|
||||||
env: {
|
env: {
|
||||||
...process.env as Record<string, string>,
|
...process.env as Record<string, string>,
|
||||||
NODE_ENV: 'test',
|
NODE_ENV: 'test',
|
||||||
@@ -103,11 +105,13 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
name: 'GoodGo Web',
|
||||||
command: `pnpm exec next dev --port ${WEB_PORT}`,
|
command: `pnpm exec next dev --port ${WEB_PORT}`,
|
||||||
cwd: './apps/web',
|
cwd: './apps/web',
|
||||||
url: `http://localhost:${WEB_PORT}`,
|
port: Number(WEB_PORT),
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
timeout: SERVER_STARTUP_TIMEOUT_MS,
|
timeout: SERVER_STARTUP_TIMEOUT_MS,
|
||||||
|
stdout: process.env.CI ? 'pipe' : 'ignore',
|
||||||
env: {
|
env: {
|
||||||
...process.env as Record<string, string>,
|
...process.env as Record<string, string>,
|
||||||
PORT: WEB_PORT,
|
PORT: WEB_PORT,
|
||||||
|
|||||||
Reference in New Issue
Block a user