6adf6f71

Author: Michael Lynch <git@mtlynch.io>

Committer: Michael Lynch <mtlynch@noreply.codeberg.org>

Simplify e2e fixtures to one per-test server fixture (#322)

The old fixtures.ts split server management across two layers: a
worker-scoped workerServer fixture holding a restart() closure with
mutable state (serverProcess, log buffers, a nextDatabaseID counter),
plus a hidden test-scoped resetServer auto-fixture that called
restart() before every test. Since every test triggered a full seed-DB
copy and server process restart anyway, the worker scope only reused a
port number and a temp directory, both trivially cheap to recreate.

Replace the two layers with a single test-scoped auto fixture that,
for each test, copies the seed database into a fresh temp directory,
starts a dedicated server process on its own free port, and tears both
down afterwards. Server startup logic now lives in a startServer()
helper that captures stdout/stderr and includes it in startup errors,
matching the old diagnostics.

Behavior is unchanged: same env vars (LITTLE_MOMENTS_E2E_DB,
LITTLE_MOMENTS_E2E_MEDIA_DIR), same binary and flags, same /about
health poll with 15s timeout, same SIGTERM-then-SIGKILL shutdown, and
the same number of DB copies and process spawns per run.

Also rename loginAsAdmin to logInAsAdmin for consistency with logInAs
and logInAsSubscriber.

Verified with nix build .#e2e-tests: 19 passed (5.8s).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Reviewed-on: https://codeberg.org/mtlynch/little-moments/pulls/322

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 2s 10s 10s 13s 2s
Eval 7s 47s 47s 55s 0s
Build 40s 6m26s 2m42s 3m23s 44s
Deploy 3m54s 3m35s 3m35s 7m29s 30s
Suite 2s 11m01s 7m26s 7m29s 1m18s

Timeline

0s1m2m3m4m5m6m7m