Skip to content

ci(coverage): add postgres + redis + mongo service containers#135

Merged
mastermanas805 merged 1 commit into
masterfrom
ci/fix-coverage-services
May 21, 2026
Merged

ci(coverage): add postgres + redis + mongo service containers#135
mastermanas805 merged 1 commit into
masterfrom
ci/fix-coverage-services

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Coverage workflow's tests were failing with dial tcp [::1]:5432: connect: connection refused because the runner had no DB — coverage was only measuring the handful of pure-unit packages.
  • Adds postgres:16-alpine, redis:7-alpine, mongo:6 service containers, mirrors the proven-green ci.yml pattern (proto+common siblings, real-migration apply, instant_customers admin DB creation, -p 1 -short test invocation).
  • Wires env vars exactly as internal/testhelpers/testhelpers.go reads them: TEST_DATABASE_URL, TEST_POSTGRES_CUSTOMERS_URL, TEST_REDIS_URL, TEST_MONGO_URI (mongo provider tests skip cleanly if unset; now they participate).
  • Test step stays continue-on-error: true so a single flaky test never drops the coverage artifact — codecov still ingests cov.out.

Per CLAUDE.md rule 23 (the local gate must equal CI) — coverage should run the same hermetic suite ci.yml does.

Test plan

  • CI runs green (or at least produces a real coverage.out)
  • Codecov upload reports a realistic coverage % (not the prior pure-unit-only slice)
  • No regression in ci.yml's separate build-and-test job

🤖 Generated with Claude Code

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>
@mastermanas805 mastermanas805 merged commit 3308465 into master May 21, 2026
11 checks passed
@mastermanas805 mastermanas805 deleted the ci/fix-coverage-services branch May 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant