Skip to content

Commit 084b2c1

Browse files
committed
We need a real DB server for the full setup integration tests
Signed-off-by: Mike Lischke <mike@lischke-online.de>
1 parent e4d34bb commit 084b2c1

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ jobs:
1515
container:
1616
image: mcr.microsoft.com/playwright:v1.59.1-noble
1717

18+
services:
19+
mysql:
20+
image: mysql:8.0
21+
env:
22+
MYSQL_ROOT_PASSWORD: localRoot#123
23+
ports:
24+
- 3306:3306
25+
options: >-
26+
--health-cmd "mysqladmin ping -h 127.0.0.1 -u root --password=localRoot#123"
27+
--health-interval 10s
28+
--health-timeout 5s
29+
--health-retries 15
30+
1831
steps:
1932
- name: Checkout repository
2033
uses: actions/checkout@v4
@@ -32,6 +45,11 @@ jobs:
3245
run: npm run build
3346

3447
- name: Run Playwright tests
48+
env:
49+
DB_HOST: mysql
50+
DB_USER: root
51+
DB_PASSWORD: localRoot#123
52+
DB_PORT: "3306"
3553
run: npm run test:e2e
3654

3755
- name: Upload Playwright report

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,4 @@ This opens the app at `http://localhost:5173` and updates automatically as you e
159159
The project is written in **TypeScript** with **Preact** for the UI, **SCSS** and **Tailwind** for styling, and **DaisyUI** for components. The backend is a plain Node.js HTTP server with MySQL/MariaDB/PostgreSQL adapters.
160160

161161
### VS Code ###
162-
This project ist developed in VS Code and already has a launch configuration you can use to start a debugging session.
162+
This project ist developed in VS Code and already has a launch configuration you can use to start a debugging session.

tests/e2e/setup-real-db.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import { existsSync, mkdirSync } from "node:fs";
1212
import { resolve } from "node:path";
1313

1414
const testDbName = "animada_e2e_setup_test";
15-
const dbUser = "root";
16-
const dbPassword = "localRoot#123";
17-
const dbHost = "127.0.0.1";
18-
const dbPort = 3306;
15+
const dbUser = process.env.DB_USER ?? "root";
16+
const dbPassword = process.env.DB_PASSWORD ?? "localRoot#123";
17+
const dbHost = process.env.DB_HOST ?? "127.0.0.1";
18+
const dbPort = process.env.DB_PORT ? Number(process.env.DB_PORT) : 3306;
1919

2020
// Use a different port to avoid conflicts with the dev server on 3100.
2121
const testBackendPort = 3199;

0 commit comments

Comments
 (0)