From f6bcb1fbe5587212a12f016034ff9d617c25f74a Mon Sep 17 00:00:00 2001 From: Julian Tabel Date: Sat, 21 Feb 2026 16:29:04 +0100 Subject: [PATCH] Fix CI failures for backend and e2e test jobs Replace astral-sh/setup-uv action with direct curl install to avoid Node.js 18 incompatibility (setup-uv v6+ requires Node 20+). Change e2e test API host port from 8000 to 8100 to avoid conflict with existing service on the CI runner. Co-Authored-By: Claude Opus 4.6 --- ...flow-failures-for-backend-and-e2e-tests.md | 21 +++++++++++++++++++ .github/workflows/ci.yml | 11 +++++----- docker-compose.test.yml | 2 +- frontend/e2e/global-setup.ts | 4 ++-- 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 .beans/nuzlocke-tracker-wtbk--fix-ci-workflow-failures-for-backend-and-e2e-tests.md diff --git a/.beans/nuzlocke-tracker-wtbk--fix-ci-workflow-failures-for-backend-and-e2e-tests.md b/.beans/nuzlocke-tracker-wtbk--fix-ci-workflow-failures-for-backend-and-e2e-tests.md new file mode 100644 index 0000000..ec1c045 --- /dev/null +++ b/.beans/nuzlocke-tracker-wtbk--fix-ci-workflow-failures-for-backend-and-e2e-tests.md @@ -0,0 +1,21 @@ +--- +# nuzlocke-tracker-wtbk +title: Fix CI workflow failures for backend and e2e tests +status: in-progress +type: bug +priority: normal +created_at: 2026-02-21T15:26:22Z +updated_at: 2026-02-21T15:27:40Z +--- + +Two failures in CI: + +1. **backend-tests**: `astral-sh/setup-uv@v6.8.0` requires Node.js 20+ but the act runner has Node.js 18. The `File` global doesn't exist in Node 18, causing a ReferenceError. Fix: install uv directly via curl instead of using the GitHub Action. + +2. **e2e-tests**: Port 8000 is already allocated on the runner host. The docker-compose.test.yml binds test-api to host port 8000 which conflicts with whatever else runs on the CI machine. Fix: use port 8100 for the test API container. + +## Checklist +- [x] Replace `astral-sh/setup-uv` action with direct curl install of uv + `uv python install 3.14` +- [x] Change e2e test API host port from 8000 to 8100 in docker-compose.test.yml +- [x] Update global-setup.ts to use port 8100 +- [x] Verify no other references to the test API port \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7b10ee..240a6fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,14 +42,15 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: persist-credentials: false - - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 - with: - python-version: "3.14" + - name: Install uv and Python + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + uv python install 3.14 - name: Install dependencies - run: uv pip install --system -e ".[dev]" + run: uv pip install --system --python 3.14 -e ".[dev]" working-directory: backend - name: Run tests - run: pytest -q + run: uv run --python 3.14 pytest -q working-directory: backend env: TEST_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5433/nuzlocke_test diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 8ee3a13..3774fb2 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -21,7 +21,7 @@ services: context: ./backend dockerfile: Dockerfile ports: - - "8000:8000" + - "8100:8000" environment: - DATABASE_URL=postgresql+asyncpg://postgres:postgres@test-db:5432/nuzlocke_test - DEBUG=true diff --git a/frontend/e2e/global-setup.ts b/frontend/e2e/global-setup.ts index 68ee9cd..1d48296 100644 --- a/frontend/e2e/global-setup.ts +++ b/frontend/e2e/global-setup.ts @@ -4,7 +4,7 @@ import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' const __dirname = dirname(fileURLToPath(import.meta.url)) -const API_BASE = 'http://localhost:8000/api/v1' +const API_BASE = 'http://localhost:8100/api/v1' const COMPOSE_FILE = resolve(__dirname, '../../docker-compose.test.yml') const COMPOSE = `docker compose -p nuzlocke-test -f ${COMPOSE_FILE}` const FIXTURES_PATH = resolve(__dirname, '.fixtures.json') @@ -48,7 +48,7 @@ export default async function globalSetup() { // 2. Wait for API to be healthy console.log('[setup] Waiting for API to be ready...') - await waitForApi('http://localhost:8000/') + await waitForApi('http://localhost:8100/') // 3. Run migrations run(`${COMPOSE} exec -T test-api alembic -c /app/alembic.ini upgrade head`)