ci(coverage): add postgres + redis + mongo service containers#135
Merged
Conversation
The coverage workflow's tests were failing with `dial tcp [::1]:5432: connect: connection refused` because the GH Actions runner had no DB. Coverage was therefore measuring only the slice of tests that don't need a DB (~handful of unit tests in pure packages). Adds postgres:15, redis:7, mongo:6 service containers + sets TEST_DATABASE_URL / TEST_POSTGRES_CUSTOMERS_URL / TEST_REDIS_URL / TEST_MONGO_URL. Tests should now run and produce a realistic coverage number. Per CLAUDE.md 95% coverage target. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
dial tcp [::1]:5432: connect: connection refusedbecause the runner had no DB — coverage was only measuring the handful of pure-unit packages.postgres:16-alpine,redis:7-alpine,mongo:6service containers, mirrors the proven-green ci.yml pattern (proto+common siblings, real-migration apply,instant_customersadmin DB creation,-p 1 -shorttest invocation).internal/testhelpers/testhelpers.goreads them:TEST_DATABASE_URL,TEST_POSTGRES_CUSTOMERS_URL,TEST_REDIS_URL,TEST_MONGO_URI(mongo provider tests skip cleanly if unset; now they participate).continue-on-error: trueso a single flaky test never drops the coverage artifact — codecov still ingestscov.out.Per CLAUDE.md rule 23 (the local gate must equal CI) — coverage should run the same hermetic suite ci.yml does.
Test plan
🤖 Generated with Claude Code