From b82a6c1d876de02ace5bd01d6a8b4c42905fcc0d Mon Sep 17 00:00:00 2001 From: derekc Date: Mon, 16 Nov 2026 23:16:10 -0800 Subject: [PATCH] Add end-to-end smoke test tests/run-smoke.sh starts an isolated copy of the stack (compose project yolkbook-smoke, nginx on 127.0.0.1:18056, throwaway credentials), optionally loads a mysqldump backup, and runs tests/smoke.py against it. The stack and its volume are removed afterwards. The test covers static pages, CSP and login rate limiting through nginx; login and lockout; CRUD and validation for eggs, flock, feed and other purchases; stats; admin user management and impersonation; password and timezone changes; logout; and rejection of tampered and alg=none tokens. The first run with a given label of "baseline" snapshots every user's list and stats output; later runs must match it exactly, and must still accept a token issued during the baseline run. State is kept in ~/.cache/yolkbook-smoke (outside the repo, since snapshots contain real data). Co-Authored-By: Claude Opus 5.5 --- tests/run-smoke.sh | 104 ++++++++++++++++++++++++++++ tests/smoke.py | 164 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 268 insertions(+) create mode 100755 tests/run-smoke.sh create mode 100644 tests/smoke.py diff --git a/tests/run-smoke.sh b/tests/run-smoke.sh new file mode 100755 index 0000000..fdda803 --- /dev/null +++ b/tests/run-smoke.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# Yolkbook smoke test on an isolated copy of the stack. +# +# Usage: tests/run-smoke.sh