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
+53
View File
@@ -0,0 +1,53 @@
# CI
`.forgejo/workflows/checkpoint.yml` runs the full checkpoint suite
(`scripts/run_checkpoint_tests.py`: migrations on a fresh DB, backend
`pytest`, all Godot smoke tests, the 2-player multiplayer test, and the
fresh-clone boot check) on every push to `main` and every PR.
**It does not run yet** — it needs a Forgejo Actions runner, which is a
one-time operator setup on the AGP host.
## Enabling it
1. **Turn on Actions in Forgejo** — in the `forgejo` container's
`app.ini`, add:
```ini
[actions]
ENABLED = true
```
then restart the container.
2. **Register a `host` runner.** The suite starts Docker containers and runs
the Godot binary, so a container runner would need docker-in-docker + a
Godot image. A `host`-type runner (runs jobs directly on the AGP box,
where Docker, `~/godot/godot`, and Python already live) is simplest:
```bash
# on the AGP host
FORGEJO_URL=http://localhost:3000
# get a token: Forgejo → Site Admin → Actions → Runners → Create
forgejo-runner register --no-interactive \
--instance "$FORGEJO_URL" --token "<token>" \
--name agp-host --labels host
forgejo-runner daemon & # or a systemd unit
```
Install `forgejo-runner` from
<https://code.forgejo.org/forgejo/runner/releases>.
3. Push a commit — the `checkpoint` workflow should appear under the repo's
**Actions** tab.
## Interim: run it by hand
Until the runner is up, the same gate is:
```bash
python scripts/run_checkpoint_tests.py
```
which is also what `/checkpoint/<PC>` on the dashboard runs before a
playtest build.