Release: test infrastructure, rules overhaul, and design refresh #30

Merged
TheFurya merged 43 commits from develop into main 2026-02-21 16:58:18 +01:00
4 changed files with 30 additions and 8 deletions
Showing only changes of commit f6bcb1fbe5 - Show all commits

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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`)