From 3791fa14c05c6d033f6ea350bdf31a3e89e326b2 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Mon, 8 Dec 2025 14:28:36 +0100 Subject: [PATCH] build(sync): add SuperSync service for E2E testing in docker-compose --- docker-compose.yaml | 33 +++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 1b340cbe9..36c7a9acb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 diff --git a/package.json b/package.json index e97ba50e2..a016a5a2d 100644 --- a/package.json +++ b/package.json @@ -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",