PC3 Phase 3.1: hermetic backend tests + fresh-clone boot check + CI workflow

- backend/tests/conftest.py: pytest_configure brings up an ephemeral
  Postgres via docker compose + runs migrations when DATABASE_URL isn't
  already reachable, and tears it down after. `cd backend && pytest` now
  works from a clean checkout with zero manual setup (72 passed in ~28s);
  no docker and no DB -> the whole suite skips with a clear message instead
  of erroring 60+ times.
- scripts/verify_fresh_clone.sh: exports a pristine tree (git archive, so no
  .godot), imports from scratch, headless-boots the main menu + game scene,
  fails on any SCRIPT ERROR / failed autoload. Catches the stale-class-cache
  class of bug. PASS.
- run_checkpoint_tests.py runs both the 2p multiplayer test and the
  fresh-clone check.
- .forgejo/workflows/checkpoint.yml + docs/ci.md: the CI workflow (runs the
  checkpoint suite on push/PR) and how to enable it -- it needs a Forgejo
  Actions `host` runner registered on the AGP box, a one-time operator step.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015jtxAiu5dAW4WxCNdGkrkJ
This commit is contained in:
2026-09-05 22:11:53 +00:00
parent 50c6a31c25
commit 855311e731
5 changed files with 238 additions and 16 deletions
+27
View File
@@ -0,0 +1,27 @@
name: checkpoint
# Runs the full checkpoint suite (migrations, backend pytest, Godot smoke
# tests, multiplayer, fresh-clone boot) on every push and PR.
#
# Requires a Forgejo Actions runner with:
# - Docker access (the suite starts an ephemeral Postgres via docker compose)
# - the Godot 4.6.2 headless binary at $HOME/godot/godot (or `godot` on PATH)
# - the backend Python deps installed (backend/requirements.txt)
# A `host`-type runner on the AGP box already has all of this. See docs/ci.md.
on:
push:
branches: [main]
pull_request:
jobs:
checkpoint:
runs-on: host
steps:
- uses: actions/checkout@v4
- name: Backend deps
run: python -m pip install -r backend/requirements.txt
- name: Checkpoint suite
run: python scripts/run_checkpoint_tests.py --postgres-port 25690 --backend-port 18690