From 941b914fa9201d9d869898b05c39940e799d14c7 Mon Sep 17 00:00:00 2001 From: ISA Date: Fri, 5 Sep 2025 07:28:44 +0200 Subject: [PATCH] test: woodpecker --- .env.development | 2 +- .env.production | 2 +- .woodpecker.yml | 9 ++++++++- CHANGELOG.md | 5 +++++ package-lock.json | 4 ++-- package.json | 4 ++-- playwright.config.ts | 17 ++++++++++------- 7 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.env.development b/.env.development index 4850b92..f07dc39 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.842 +NEXT_PUBLIC_APP_VERSION=1.6.843 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index b571873..6d48fec 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.842 +NEXT_PUBLIC_APP_VERSION=1.6.843 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/.woodpecker.yml b/.woodpecker.yml index e81e3c9..e8cf7b0 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -28,11 +28,18 @@ steps: image: mcr.microsoft.com/playwright:v1.54.2-jammy environment: CI: "true" - NODE_ENV: "development" + NODE_ENV: "production" NEXT_TELEMETRY_DISABLED: "1" PORT: "3000" commands: + - node -v && npm -v - npm ci + - npm run build + # Start local static simulator in background + - node scripts/local-cpl-sim.mjs & + # Wait until simulator responds on port 3000 (no curl dependency) + - | + node -e "const http=require('http');let n=120;function ping(){http.get('http://localhost:3000',res=>{console.log('Server is up');process.exit(0)}).on('error',()=>{if(n--<=0){console.error('Server did not start');process.exit(1)}setTimeout(ping,1000)});}ping();" - npx playwright test --project=chromium - name: notify-success image: alpine/curl:latest diff --git a/CHANGELOG.md b/CHANGELOG.md index ea7f2c3..5f85731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.843] – 2025-09-05 + +- feat: local-cpl-sim.mjs port 3000 + +--- ## [1.6.842] – 2025-09-05 - refactor: retime all messages and charts data diff --git a/package-lock.json b/package-lock.json index 0a4cba9..8863892 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.842", + "version": "1.6.843", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.842", + "version": "1.6.843", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index 7b83b29..c38a65e 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.842", + "version": "1.6.843", "private": true, "scripts": { "dev": "next dev -p 3000", "clean": "rimraf .next out", "build": "npm run clean && cross-env EXPORT_STATIC=true next build", - "postbuild": "copy LICENSE_ICONIFY.txt out\\LICENSE_ICONIFY.txt", + "postbuild": "node -e \"const fs=require('fs');const path=require('path');fs.mkdirSync('out',{recursive:true});fs.copyFileSync('LICENSE_ICONIFY.txt', path.join('out','LICENSE_ICONIFY.txt'))\"", "serve:sim": "node ./scripts/local-cpl-sim.mjs", "start": "next start", "typecheck": "tsc --noEmit", diff --git a/playwright.config.ts b/playwright.config.ts index e2328e2..9d471d3 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -31,11 +31,14 @@ export default defineConfig({ }, projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }], - - webServer: { - command: "npm run dev -- -p 3000", // wichtig: "--" damit npm das "-p" an next weiterreicht - url: "http://localhost:3000", - reuseExistingServer: true, - timeout: 120_000, - }, + // In CI starten wir den statischen Simulator selbst (siehe .woodpecker.yml), + // daher kein automatischer dev-Webserver hier. + webServer: CI + ? undefined + : { + command: "npm run dev -- -p 3000", // wichtig: "--" damit npm das "-p" an next weiterreicht + url: "http://localhost:3000", + reuseExistingServer: true, + timeout: 120_000, + }, });