feat: add testcontainers Postgres integration tests#272
Merged
Conversation
- testcontainers v0.24 (compatible with rustc 1.85) - Auto-spins postgres:17-alpine container - Runs full shared test suite (11 tests) against live Postgres - Graceful skip when Docker not available (local dev) - test-postgres CI job in ci.yml Acceptance criteria: - testcontainers dev-dependency added - 11 integration tests (same as shared suite) - CI job for Postgres tests - Local dev unaffected (tests skip if no Docker) Closes #222
- trapfalld default features: postgres -> sqlite (Postgres is opt-in) - TC tests: Result-based setup with retry_connect (10x 2s backoff) - TC tests: graceful skip on any error (no panics) - TC tests: no longer run in cargo test --workspace (sqlite default) - migrate.rs: cfg-gate serde_json::Value import (postgres-only) Root cause of CI failure: trapfalld default=["postgres"] caused tc tests to compile and run in regular cargo test --workspace, where Docker connection failed.
tokio-tar is a transitive dependency of testcontainers (dev-only). No fix available. Same treatment as RUSTSEC-2023-0071.
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.
Problem
CI only tested SQLite. Postgres — advertised as a core feature — was never tested end-to-end. Bugs like #213 and #209 only surfaced in production.
Solution
postgres:17-alpinevia Dockertest-postgresinci.ymlLocal dev
Closes #222