Skip to content

Commit 3c23749

Browse files
committed
Fix E2E tests: improve server startup and Playwright configuration
- Fix backend/frontend server startup with proper PID handling - Add explicit CI environment variable for Playwright - Add timeout configuration to Playwright config - Improve server startup logging
1 parent ada74f1 commit 3c23749

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,11 @@ jobs:
237237
- name: Start backend server
238238
working-directory: backend
239239
run: |
240-
nohup uvicorn main:app --host 0.0.0.0 --port 8000 > /tmp/backend.log 2>&1 &
241-
echo $! > /tmp/backend.pid
240+
uvicorn main:app --host 0.0.0.0 --port 8000 > /tmp/backend.log 2>&1 &
241+
BACKEND_PID=$!
242+
echo $BACKEND_PID > /tmp/backend.pid
243+
echo "Backend started with PID: $BACKEND_PID"
244+
sleep 3
242245
env:
243246
DATABASE_URL: postgresql+asyncpg://test:test@localhost:5432/test
244247
REDIS_URL: redis://localhost:6379
@@ -261,8 +264,11 @@ jobs:
261264
- name: Start frontend server
262265
working-directory: web
263266
run: |
264-
nohup npm start > /tmp/frontend.log 2>&1 &
265-
echo $! > /tmp/frontend.pid
267+
npm start > /tmp/frontend.log 2>&1 &
268+
FRONTEND_PID=$!
269+
echo $FRONTEND_PID > /tmp/frontend.pid
270+
echo "Frontend started with PID: $FRONTEND_PID"
271+
sleep 3
266272
env:
267273
NEXT_PUBLIC_API_URL: http://localhost:8000/graphql
268274

@@ -308,7 +314,10 @@ jobs:
308314
working-directory: tests
309315
env:
310316
E2E_BASE_URL: http://localhost:3000
311-
run: npx playwright test
317+
CI: true
318+
run: |
319+
echo "E2E_BASE_URL is set to: $E2E_BASE_URL"
320+
npx playwright test
312321
313322
- name: Upload Playwright report
314323
if: always()

tests/e2e/playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
baseURL: process.env.E2E_BASE_URL || 'http://localhost:3000',
1212
trace: 'on-first-retry',
1313
},
14+
timeout: 30000,
1415
projects: [
1516
{
1617
name: 'chromium',

0 commit comments

Comments
 (0)