Prep for the upcoming E2E Playwright CI workflow. The full seed (1200
users, 5000 tracks, 100k play events, 10k messages, etc.) takes ~60s
and produces a lot of fixture data the suite never reads. A CI run
just needs the 5 test accounts the auth fixture logs in as
(admin/artist/user/mod/new) plus a small content set so player /
playlist tests have something to render.
New flag:
go run ./cmd/tools/seed --ci
CIConfig (cmd/tools/seed/config.go):
- TotalUsers = 5 (== len(testAccounts), so SeedUsers' "remaining"
branch is a no-op — only the 5 hardcoded accounts get inserted).
- Tracks = 10, Playlists = 3 (covers player + playlist suites).
- Albums = 0, all social/chat/live/marketplace/analytics/etc. = 0.
main.go gates the heavy seeders (Social / Chat / Live / Marketplace /
Analytics / Content / Moderation / Notifications / Misc) behind
`if !cfg.CIMode`, prints a one-line "skipping ..." banner so the run
log makes the choice obvious. The Users / Tracks / Playlists path is
unchanged — same code, same validation pass at the end.
Time: ~5s in CI mode (bcrypt cost 12 × 5 + a handful of bulk inserts)
vs the ~60s minimal mode and ~5min full mode, measured locally
against a tmpfs Postgres.
Validate() and the SUMMARY printout work unchanged — empty tables
just show "0 rows", and the orphan-FK checks remain useful (and pass
trivially when the heavy seeders are skipped).
modeName() returns "CI" so the boot banner reflects the choice.
go build ./... clean. Help output:
-ci Bare-minimum seed for E2E CI (...)
-minimal Use reduced volumes (50 users, 200 tracks) for fast dev
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>