test: real-Postgres harness and an HTTP send-and-read e2e - #39
Merged
TheGreatAxios merged 1 commit intoSep 27, 2026
Conversation
TheGreatAxios
commented
Sep 25, 2026
TheGreatAxios
left a comment
Contributor
Author
There was a problem hiding this comment.
Self-review: the branch went through two independent review passes, and every finding is fixed. Two findings were waived after a senior ruling: the README stays stale on #37 until #38 lands, and the default resolver has no null guard because TenantEnv guarantees tenant and principal. Build, typecheck and 171 tests pass against real Postgres.
TheGreatAxios
force-pushed
the
cl-9325-mailbox-add-shared-real-postgres-test-harness-in-tests
branch
from
September 25, 2026 15:02
4e453bb to
c3a026d
Compare
TheGreatAxios
force-pushed
the
cl-9325-mailbox-add-shared-real-postgres-test-harness-in-tests
branch
2 times, most recently
from
September 26, 2026 01:28
bbeb192 to
ee340ad
Compare
TheGreatAxios
added this pull request to stack #47
September 26, 2026 01:58
A suite gets its own migrated database behind a host that plays the tenant middleware, so a test drives the routes the way a hub does rather than calling internals. Closes CL-9325, CL-9072.
TheGreatAxios
force-pushed
the
cl-9325-mailbox-add-shared-real-postgres-test-harness-in-tests
branch
from
September 26, 2026 02:40
ee340ad to
5ed809f
Compare
TheGreatAxios
removed this pull request from stack #47
September 26, 2026 02:40
TheGreatAxios
added this pull request to stack #50
September 26, 2026 02:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/lib/db-harness.tscreates a fresh database per suite, applies the control plane andrunMailboxMigrations, and drops it on close (also on a failed setup).createTestAppplays the tenant middleware and mountscreateMailboxRouteson aHono<TenantEnv>.tests/send-and-read.test.ts: alice sends over HTTP; bob lists his inbox and reads the thread.bun run testand CI runsrcandtests. The test role needsCREATEDB(CI'spostgresuser has it). The unusedMAILBOX_DATABASE_URLis dropped.Verification
CI is green on this branch: install
--frozen-lockfile, build, typecheck, tests against Postgres, and the Node consumer smoke test.Closes CL-9325
Closes CL-9072