Live-Postgres tests: exercise the pending-link methods; add a standing live run #4

Merged
heimdall merged 2 commits from heimdall/live-pg-exercise-pending-links into main 2026-11-06 00:32:57 +00:00
Member

Two tests in tests/store.test.ts ("startup against a live Postgres") fail on main when run against a real Postgres. They skip without HEIMDALL_TEST_PG_ADMIN_URL, so the default vitest run never showed it.

Cause. exerciseStore is the probe that calls every PostgresStore method. createPendingLink, consumePendingLink and findAuthCompletion (PRs #1/#2) were never added to it.

  • "serves every store operation..." asserts called == offered methods, so it missed those three.
  • "refuses each privilege taken away..." saw no 42501 when SELECT on pending_links was revoked, because nothing touched that table.

The store and the privilege table (pending_links: SELECT, INSERT, UPDATE) were right; only the probe was behind.

Fix. Call the three methods in exerciseStore.

Standing run. scripts/test-live-pg.sh starts a throwaway cluster, sets HEIMDALL_TEST_PG_ADMIN_URL and SOUL_PG_URL, runs the full suite, and removes the cluster. Result: 28 files passed, 716 tests passed, 10 skipped. The skips are not Postgres: uid, bundle-boot and a presence guard. Needs initdb/pg_ctl (PG_BIN overrides the path). Not wired into the Idunn recipe: that needs PG server binaries on the builder, which is a deployment call.

No deploy.

🤖 Generated with Claude Code

Two tests in `tests/store.test.ts` ("startup against a live Postgres") fail on main when run against a real Postgres. They skip without `HEIMDALL_TEST_PG_ADMIN_URL`, so the default `vitest run` never showed it. **Cause.** `exerciseStore` is the probe that calls every `PostgresStore` method. `createPendingLink`, `consumePendingLink` and `findAuthCompletion` (PRs #1/#2) were never added to it. - "serves every store operation..." asserts called == offered methods, so it missed those three. - "refuses each privilege taken away..." saw no 42501 when SELECT on `pending_links` was revoked, because nothing touched that table. The store and the privilege table (`pending_links: SELECT, INSERT, UPDATE`) were right; only the probe was behind. **Fix.** Call the three methods in `exerciseStore`. **Standing run.** `scripts/test-live-pg.sh` starts a throwaway cluster, sets `HEIMDALL_TEST_PG_ADMIN_URL` and `SOUL_PG_URL`, runs the full suite, and removes the cluster. Result: 28 files passed, 716 tests passed, 10 skipped. The skips are not Postgres: uid, bundle-boot and a presence guard. Needs `initdb`/`pg_ctl` (`PG_BIN` overrides the path). Not wired into the Idunn recipe: that needs PG server binaries on the builder, which is a deployment call. No deploy. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The live suite asserts that exerciseStore calls every PostgresStore method and
that dropping any one table privilege makes it fail with 42501. createPendingLink,
consumePendingLink and findAuthCompletion landed without a call there, so the
coverage assertion failed, and with no operation touching pending_links the
privilege test saw no error when SELECT on it was revoked. Both failures were
invisible because the live files skip without HEIMDALL_TEST_PG_ADMIN_URL.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Heimdall!4
No description provided.