From a797f8e17cdd1a86ad03c27e07721238f6634db4 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Fri, 1 May 2026 07:03:16 +0100 Subject: [PATCH] fix(ci): start MongoDB explicitly via docker run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Forgejo runner isn't honoring the 'services:' block — the playwright job booted the server cleanly but every Mongo query returned ECONNREFUSED on 127.0.0.1:27017. Replace 'services:' with an explicit 'docker run -d' step + nc-based readiness wait. --- .forgejo/workflows/test.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 6885359..341d399 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -21,11 +21,6 @@ jobs: playwright: runs-on: ubuntu-latest needs: vitest - services: - mongo: - image: mongo:7 - ports: - - 27017:27017 env: MONGODB_URI: mongodb://localhost:27017/ghostguild-test JWT_SECRET: ci-test-jwt-secret @@ -43,6 +38,10 @@ jobs: cache: npm - run: npm ci - run: npx playwright install --with-deps chromium + - name: Start MongoDB + run: docker run -d --name mongo-ci -p 27017:27017 mongo:7 + - name: Wait for MongoDB + run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done' - run: npm run build - name: Start server run: node .output/server/index.mjs > /tmp/server.log 2>&1 & @@ -79,11 +78,6 @@ jobs: runs-on: ubuntu-latest needs: vitest continue-on-error: true - services: - mongo: - image: mongo:7 - ports: - - 27017:27017 env: MONGODB_URI: mongodb://localhost:27017/ghostguild-test JWT_SECRET: ci-test-jwt-secret @@ -101,6 +95,10 @@ jobs: cache: npm - run: npm ci - run: npx playwright install --with-deps chromium + - name: Start MongoDB + run: docker run -d --name mongo-ci -p 27017:27017 mongo:7 + - name: Wait for MongoDB + run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done' - run: npm run build - name: Start server run: node .output/server/index.mjs > /tmp/server.log 2>&1 &