Skip to content

chore(test): migrate exchange test setup to gormx.MustStartTestSuite#583

Open
dorothyyzh wants to merge 5 commits into
masterfrom
fix/use-gormx-muststarttestsuite-2026-05-13
Open

chore(test): migrate exchange test setup to gormx.MustStartTestSuite#583
dorothyyzh wants to merge 5 commits into
masterfrom
fix/use-gormx-muststarttestsuite-2026-05-13

Conversation

@dorothyyzh
Copy link
Copy Markdown
Contributor

Summary

Migrate exchange/setup_test.go from OpenContainer + gorm.Open to gormx.MustStartTestSuite for container lifecycle management.

Uses testSuite.DSN() to open a plain gorm.Open connection rather than testSuite.DB(), because exchange's importer creates nested associations for new records during CreateInBatches — this is incompatible with the OmitAssociationsPlugin that MustStartTestSuite installs on its managed connection.

Verification

  • go test ./exchange/... — all tests pass

dorothyyzh and others added 5 commits May 13, 2026 19:14
Use MustStartTestSuite to manage the PostgreSQL container lifecycle.
Open a plain gorm.Open connection from testSuite.DSN() instead of using
testSuite.DB(), because exchange's importer relies on GORM creating nested
associations for new records during CreateInBatches — incompatible with
the OmitAssociationsPlugin that SetupDatabase (and thus MustStartTestSuite)
installs on its managed connection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and CVE-2026-34040

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Provides redisx.MustStartTestSuite for integration tests, mirroring
the gormx.MustStartTestSuite pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er transitive dep

Co-Authored-By: Claude Sonnet 4.6 <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.

2 participants