Repository navigation
test: postgres-backed e2e - #707
Conversation
Spec 013 US5 (T054-T057): TestPostgres_MigrateFromFrozenBaseline upgrades a schema stopped at the frozen 001-012 set to head and checks rows survive; deploy/kind/postgres.yaml and an e2e.sh postgres profile run the API on PostgreSQL in kind; the new e2e postgres job re-runs api-auth, api-roles and api-rbac against it, restarting the API between buckets so each gets a fresh in-memory login limiter. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughAdds PostgreSQL migration regression coverage and a PostgreSQL-backed Kind profile. CI runs selected API E2E buckets against PostgreSQL and includes the job in its report. ChangesPostgreSQL validation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Other Suggested labels: Merge Risk: ⚪ Minimal · up to
|
|
Cause: this is a real chart bug that the new job exposes. The chart passes the database to the API only as container args ( Proposed fix: also set Generated by Claude Code |
CI Report - 8c0410frun 38826485921 - attempt 1 0 failed - 33 passed - 0 skipped - 60m36s elapsed Coverage
Changed
Slowest jobs
e2e buckets run
|
bootstrap-admin and other subcommands run through kubectl exec don't see the container's --db-driver/--db-dsn args, so on a PostgreSQL install they fell back to the SQLite default in the emptyDir and the new admin never reached the real database. Set GAMEPLANE_DB_DRIVER and GAMEPLANE_DB_DSN from the same values. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
@coderabbitai review Generated by Claude Code |
✅ Action performedReview finished.
|
|
CodeRabbit's Docstring Coverage warning (75%) counts the one-line Generated by Claude Code |
Before: the Postgres store was only tested at the DB layer (
api (postgres)), and nothing showed that a database stuck at the frozen 001–012 migrations upgrades cleanly. No E2E run used a Postgres-backed API (spec 013 gaps G-23, G-24).After: a new
e2e postgres / amd64 (kind)job brings up kind with PostgreSQL 17 and installs the chart withapi.db.driver=postgres. It checks that the API Deployment runs with--db-driver=postgres, then runs theapi-auth,api-rolesandapi-rbacbuckets against it.api (postgres)also runs the newTestPostgres_MigrateFromFrozenBaseline, which applies onlymigrations/postgres001–012, writes a user, a role binding, a share link and an audit row with the 012-era columns, migrates to head, and checks all four rows read back unchanged and every version is recorded.How:
deploy/kind/postgres.yamlholds the StatefulSet, Service and Secret, using the same image digest as theapi (postgres)service.deploy/kind/e2e.shtakes an optional fourth argument, the profile. Thepostgresprofile applies that fixture, waits forpg_isready, retagsgameplane-test/api:e2e-postgresunder the shared tag, and adds the driver and DSN to the Helm install.newPostgresStoreis split so the new test can open an unmigrated schema. The existing tests behave the same.Chart fix found by the new job (valgul chose "Fix in #707"): the chart passed the database to the API only as container args, so
kubectl exec deploy/gameplane-api -- /api bootstrap-admin(docs/install.md) fell back to SQLite on a PostgreSQL install and created the admin in a throwaway emptyDir file.charts/gameplane/templates/api.yamlnow also setsGAMEPLANE_DB_DRIVERandGAMEPLANE_DB_DSNon theapicontainer.Spec 013 tasks T054–T057. G-23 and G-24 flip after the first green run (T058).
Two deviations from the task text:
e2e.sh up "$CLUSTER" postgres, but the third argument is already the image tag, so the job callse2e.sh up "$CLUSTER" e2e postgres.go teststeps in T057.Generated by Claude Code
Summary by CodeRabbit