Skip to content

fix(test): convert the pg suites missed by the shared container change - #1958

Merged
AmanGIT07 merged 1 commit into
mainfrom
fix-shared-postgres-test-client
Sep 29, 2026
Merged

AmanGIT07 merged 1 commit into
mainfrom
fix-shared-postgres-test-client

Conversation

@rohilsurana

Copy link
Copy Markdown
Member

Summary

main does not compile. The internal/store/postgres test package fails to build, so the unit and golangci jobs fail on every PR opened against it.

#1934 moved the package to one shared postgres container. newTestClient now takes no arguments and returns two values, and purgeDocker is gone because TestMain tears the container down centrally. That change converted 28 test files. Seven were missed.

The seven were not overlooked. They landed on main from a parallel series while #1934 sat in review, so they did not exist in that branch. Git merged both sides without a conflict because no two commits touched the same lines. Nothing compiled the result until after the merge.

Changes

Each one drops its pool and resource fields, calls newTestClient(), and closes its client with closeTestClient instead of purging the container. The dockertest, io and log/slog imports go with them. No test logic changes.

Technical Details

The edit is the same in all seven files, so it is quicker to read one and skim the rest.

There is no behaviour change. Each suite still gets its own database, because newTestClient creates a fresh one from the migrated template per call. It just no longer starts and stops its own container.

Worth knowing for next time: a rebase is not enough to catch this. The merge is clean at the text level and only the compiler sees the problem. A required check that builds the merge result would have caught it before the merge rather than after.

Test Plan

  • go vet ./internal/store/postgres/... passes. It fails on main today.
  • go test ./internal/store/postgres/ passes end to end against a real postgres, 41s for the whole package.
  • golangci-lint run ./internal/store/postgres/... reports 0 issues. It reports a typecheck failure on main today.

SQL Safety (if your PR touches *_repository.go or goqu.*)

Not applicable. This PR only touches _test.go files and changes no queries.

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
frontier Ready Ready Preview Sep 29, 2026 6:51am UTC

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Pull request is closed - (🔄 Check again to try again)

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 36533234902

Warning

No base build found for commit be8569a on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 52.7%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 41252
Covered Lines: 21740
Line Coverage: 52.7%
Coverage Strength: 16.91 hits per line

💛 - Coveralls

@AmanGIT07
AmanGIT07 merged commit af7634f into main Sep 29, 2026
8 checks passed
@AmanGIT07
AmanGIT07 deleted the fix-shared-postgres-test-client branch September 29, 2026 07:01

This branch was successfully deployed

1 active deployment
Preview — 04a55933 Deployed Sep 29, 2026 by vercel[bot]
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.

3 participants