build(sync): add SuperSync service for E2E testing in docker-compose

This commit is contained in:
Johannes Millan 2025-12-08 14:28:36 +01:00
parent 11375db7a7
commit 3791fa14c0
2 changed files with 35 additions and 1 deletions

View file

@ -1,4 +1,37 @@
services:
# SuperSync server for E2E testing
# Start with: docker compose up -d supersync
# Required for @supersync e2e tests
supersync:
build:
context: .
dockerfile: packages/super-sync-server/Dockerfile.test
ports:
- '1900:1900'
environment:
- PORT=1900
- TEST_MODE=true
- TEST_MODE_CONFIRM=yes-i-understand-the-risks
- JWT_SECRET=e2e-test-secret-minimum-32-chars-long-for-security
- CORS_ORIGINS=*
- DATA_DIR=/data
tmpfs:
- /data # In-memory SQLite for test isolation
healthcheck:
test:
[
'CMD',
'wget',
'--quiet',
'--tries=1',
'--spider',
'http://localhost:1900/health',
]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
# Super Productivity app
app:
image: johannesjo/super-productivity:latest

View file

@ -50,7 +50,7 @@
"dist:win:only": "electron-builder --win",
"dist:win:store": "git pull && npm run && copy electron-builder.win-store.yaml electron-builder.yaml && npm run dist:win && git checkout electron-builder.yaml || git checkout electron-builder.yaml",
"droid": "npm run buildFrontend:stageWeb:unminified && npx cap sync",
"pree2e": "npm run plugins:build:silent",
"pree2e": "npm run plugins:build",
"e2e": "npx playwright test --config e2e/playwright.config.ts --reporter=line",
"e2e:ui": "npx playwright test --config e2e/playwright.config.ts --ui",
"e2e:file": "npx playwright test --config e2e/playwright.config.ts --reporter=list",
@ -59,6 +59,7 @@
"e2e:show-report": "npx playwright show-report .tmp/e2e-test-results/playwright-report",
"e2e:report": "PLAYWRIGHT_HTML_REPORT=1 npx playwright test --config e2e/playwright.config.ts",
"e2e:webdav": "docker compose up -d webdav && ./scripts/wait-for-webdav.sh && npm run e2e -- --grep webdav; docker compose down",
"e2e:supersync": "docker compose up -d --build supersync && echo 'Waiting for SuperSync server...' && until curl -s http://localhost:1900/health > /dev/null 2>&1; do sleep 1; done && echo 'Server ready!' && npm run e2e -- --grep @supersync; docker compose down supersync",
"electron": "NODE_ENV=PROD electron .",
"electron:build": "tsc -p electron/tsconfig.electron.json",
"electron:watch": "tsc -p electron/tsconfig.electron.json --watch",