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
+10
View File
@@ -166,6 +166,16 @@ def main():
mp_env["GODOT_BIN"] = godot_bin
r = run(["bash", str(mp_script)], env=mp_env)
results["multiplayer 2p test"] = r.returncode == 0
# Fresh-clone boot: a from-scratch tree must import + boot with
# zero script errors (no reliance on a committed .godot cache).
fc_script = ROOT / "scripts" / "verify_fresh_clone.sh"
if fc_script.exists():
print("\n--- scripts/verify_fresh_clone.sh ---")
fc_env = os.environ.copy()
fc_env["GODOT_BIN"] = godot_bin
r = run(["bash", str(fc_script)], env=fc_env)
results["fresh-clone boot"] = r.returncode == 0
finally:
server_proc.terminate()
try: