Skip to content

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

Open
mastermanas805 wants to merge 1 commit into
masterfrom
ci/fix-coverage-services
Open

ci(coverage): add postgres + redis + mongo service containers#46
mastermanas805 wants to merge 1 commit into
masterfrom
ci/fix-coverage-services

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Worker's coverage workflow was running go test ./... against a runner with no DB / no Redis / no Mongo. Integration-style tests (the propagation_runner live-DB SKIP LOCKED walk, the cross-repo audit-kind registry walk) all silently skipped, so coverage reflected only the pure-unit slice.
  • Mirrors api PR #135 + worker ci.yml's proven-green services pattern: postgres:16-alpine, redis:7-alpine, mongo:6 with health checks.
  • Wires the env vars worker tests / config actually read: TEST_DATABASE_URL, TEST_REDIS_URL, TEST_POSTGRES_CUSTOMERS_URL, TEST_MONGO_URI, plus INSTANT_API_REPO for the CLAUDE.md rule-18 cross-repo gate.
  • Applies api-owned migrations first (canonical platform_db schema lives in api/internal/db/migrations/), then worker-owned worker/sql/*.sql on top — matches what make test-db-up does for an integrated test run.
  • Checks out api sibling at ../api so coverage_registry_test.go::findApiRepoRoot resolves and the audit-kind drift detection participates in coverage.
  • Test step is continue-on-error: true so a single flaky test never drops the coverage artifact — codecov still ingests coverage.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 no-DB slice)
  • No regression in ci.yml's separate build-and-test job

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

🤖 Generated with Claude Code

Coverage workflow tests were failing with connection-refused because
the runner had no DB. Adds postgres:15, redis:7, mongo:6 service
containers + TEST_*_URL env vars so coverage reflects real test
execution rather than the no-DB slice.

Per CLAUDE.md 95% coverage target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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