-
Notifications
You must be signed in to change notification settings - Fork 0
feat(test): add comprehensive multi-database testing infrastructure #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add multi-container support for MongoDB 4.4, MongoDB 8.0, and DocumentDB - Migrate all existing tests to run against all three databases - Add unicode test suite covering CJK, Arabic, emoji, and special characters - Add complex query tests (nested $and/$or, $elemMatch, cursor modifiers) - Add BSON helper function tests (ObjectId, ISODate, NumberLong, etc.) - Add fuzz tests for edge case discovery - Add shared test fixtures (users, unicode samples, complex documents) - Add fixture loader utility for test data management Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a multi-database integration testing setup (MongoDB 4.4, MongoDB 8.0, and DocumentDB) and expands the test suite to validate behavior across engines, including unicode handling, complex queries, BSON helpers, and fuzzing.
Changes:
- Introduces multi-container test infrastructure and helpers (
GetAllClients,RunOnAllDBs) plus fixture loading utilities. - Migrates existing integration tests to run against all supported databases in parallel subtests.
- Adds new test suites (unicode round-trips, BSON helper coverage, fuzz tests) and new JSON fixtures.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| write_test.go | Migrates write-operation tests to run across all DBs via RunOnAllDBs. |
| error_test.go | Runs error-path tests across all DBs with per-DB database names. |
| database_test.go | Runs database/collection metadata tests across all DBs. |
| collection_test.go | Runs extensive collection/query/aggregate tests across all DBs and adds new query coverage. |
| unicode_test.go | Adds unicode-focused integration tests (CJK/Arabic/emoji, unicode collection names, fixture round-trip). |
| fuzz_test.go | Adds Go fuzz tests for filters and inserts (integration-level). |
| internal/testutil/container.go | Implements multi-container startup (mongo4/mongo8/documentdb) and test helper APIs. |
| internal/testutil/container_test.go | Adds tests validating the multi-container helper behavior and fixture loading. |
| internal/testutil/fixtures.go | Adds JSON fixture loader utilities for tests. |
| internal/translator/bson_helpers_test.go | Adds end-to-end tests for BSON helper function conversions. |
| testdata/users.json | Adds user fixture data. |
| testdata/unicode_samples.json | Adds unicode fixture data for round-trip testing. |
| testdata/complex_documents.json | Adds complex document fixture data for advanced query coverage. |
| go.mod | Promotes testcontainers-go to a direct dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Pin DocumentDB image to version 1.0.0
- Fix port spec consistency ("10260/tcp")
- Add slices.SortFunc for stable DB ordering
- Add ping verification to setupMongoDB
- Require all 3 DBs in TestMultiContainer
- Fix distinct test to assert both values explicitly
- Remove fuzz tests
Co-Authored-By: Claude Opus 4.5 <[email protected]>
010cb4f to
3c78f66
Compare
Summary
testutil.RunOnAllDBs$and/$or,$elemMatch, cursor modifiers)Test plan
🤖 Generated with Claude Code