Files
app/.gitea/workflows/playwright.yml
T
stroblmeandClaude Opus 5 d4a9406c51
Docs / docs (push) Successful in 49s
Playwright Tests / test-playwright (1, 2) (push) Failing after 1m11s
Playwright Tests / test-playwright (2, 2) (push) Failing after 23s
pre-commit / pre-commit (push) Successful in 3m2s
Test Backend / test-backend (push) Successful in 2m22s
Compose Smoke Test / test-compose (push) Failing after 22s
Playwright Tests / merge-reports (push) Canceled after 1s
Fix the CI gates: Python 3.13, concurrency groups, hook violations
The gates have never gone green on the new runners. Three separate reasons:

- backend/Dockerfile shipped Python 3.10 while the code imports typing.Self
  and datetime.UTC, so the container exited on import and the suite could not
  even load its conftest. The image moves to 3.13 and the packages declare
  >=3.12, which is the floor the tests actually pass on; ruff's target follows
  and rewrites timezone.utc and asyncio.TimeoutError accordingly. Relocking
  drops the 3.10 branch, which bumps FastAPI and so regenerates the SDK.
- frontend/README.md had no trailing newline and two dashboard widgets used
  arbitrary text-[…] sizes. Both are em-relative on purpose, so they move to
  the inline style the neighbouring ramp already uses.
- Every commit left its own run queued: without a concurrency group a runner
  that was offline for a while works through a backlog nobody reads. A stack
  that fails to come up now prints its logs before the teardown removes it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 14:55:59 +02:00

116 lines
4.1 KiB
YAML

name: Playwright Tests
on:
push:
branches:
- main
paths:
- backend/**
- frontend/**
- docker/compose*.yml
- .env.example
- .gitea/workflows/playwright.yml
pull_request:
types:
- opened
- synchronize
paths:
- backend/**
- frontend/**
- docker/compose*.yml
- .env.example
- .gitea/workflows/playwright.yml
# A new push supersedes the run still queued for the commit before it. Without
# this each commit leaves its own run in the queue and a runner that was offline
# for a while works through a backlog of results nobody will read.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# The playwright runner service comes from the dev overlay. It loads the SPA
# from the nginx `frontend` service and reaches the API as http://backend:8000
# on the project network — both wired up in compose.ci.yml.
COMPOSE_FILE: docker/compose.yml:docker/compose.dev.yml:docker/compose.ci.yml
# frontend/playwright.config.ts keys the blob reporter, the retries and
# forbidOnly off CI, and compose.dev.yml forwards it into the container.
CI: "true"
jobs:
test-playwright:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# Nine spec files under tests/, plus tests/auth.setup.ts, which every
# shard reruns as its setup project. Split two ways: each shard pays a
# full compose stack's startup, so more of them would spend more time
# booting than testing.
shardIndex: [1, 2]
shardTotal: [2]
env:
# One stack per shard, so a `down -v` cannot reach the other shard's
# volumes. compose.ci.yml above drops the fixed container_names and host
# ports, which the project name does not cover — without it two shards on
# the same runner host collide on the daemon-global names.
COMPOSE_PROJECT_NAME: fluksio-app-ci-pw-${{ matrix.shardIndex }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write .env
# Not committed; compose interpolates it and the runner container reads
# FIRST_SUPERUSER / FIRST_SUPERUSER_PASSWORD out of it (tests/config.ts).
run: cp .env.example .env
- run: docker compose build backend frontend playwright
- run: docker compose down -v --remove-orphans
# PLAYWRIGHT_BASE_URL points the browser at `frontend`, which is not a
# dependency of the playwright service, so bring it up explicitly.
- run: docker compose up -d --wait backend frontend
- name: Run Playwright tests
run: >-
docker compose run --rm playwright
bunx playwright test --trace=retain-on-failure
--shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Tear down
if: always()
run: docker compose down -v --remove-orphans
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: frontend/blob-report
include-hidden-files: true
retention-days: 1
merge-reports:
needs:
- test-playwright
# Merge even when a shard failed — that report is the one worth reading.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Download blob reports
uses: actions/download-artifact@v4
with:
path: frontend/all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into an HTML report
run: bunx playwright merge-reports --reporter html ./all-blob-reports
working-directory: frontend
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: frontend/playwright-report
include-hidden-files: true
retention-days: 7