test/infra: pg-pool DATABASE_URL test, event wire-format guard, docker/render hardening - #1064
Merged
ogazboiz merged 1 commit intoJul 29, 2026
Conversation
- Add pg-pool.test.ts asserting createPgPoolConfig/createPgPool pick up an overridden DATABASE_URL, with pg.Pool mocked (no real connection). - Add a contract-side test pinning stream_created's emitted Map field names against soroban-event-worker.ts's decodeMap expectations, plus doc comments in events.rs describing the wire format contract. - Add events-wire-format.test.ts as the matching backend fixture, asserting decodeMap() exposes every field each event handler reads. - Document the Postgres pinning/upgrade policy in docker-compose.yml (image was already pinned to an immutable digest).
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
Closes #1055
Closes #1056
Closes #1057
Closes #1058
backend/tests/pg-pool.test.tsassertingcreatePgPoolConfig/createPgPoolpick up an overriddenDATABASE_URL, withpg.Poolmocked so no real connection is opened.test_stream_created_event_field_names_match_decoder_expectationsincontracts/stream_contract/src/test.rs) that captures the raw emittedMapfield names forstream_createdand asserts they match whatsoroban-event-worker.ts'sdecodeMapexpects. Added a matching backend fixture (backend/tests/events-wire-format.test.ts) pinning the field set for every event type the worker decodes. Documented the wire-format contract inevents.rsdoc comments.docker-compose.yml's Postgres service was already pinned to an immutable digest (postgres:16-alpine@sha256:...); added a comment documenting the pin and the upgrade policy.render.yamlalready setshealthCheckPath: /healthagainst the existingbackend/src/routes/health.routes.tsendpoint; verified it's correctly wired, no code change needed.Test plan
cargo testincontracts/stream_contract— 106 passednpx vitest run tests/pg-pool.test.ts— 2 passednpx vitest run tests/events-wire-format.test.ts— 9 passeddocker compose config -qvalidatesdocker-compose.yml