Skip to content

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Jan 23, 2026

Summary

  • Add multi-container support for MongoDB 4.4, MongoDB 8.0, and DocumentDB running in parallel
  • Migrate all existing tests to run against all three databases using testutil.RunOnAllDBs
  • 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, UUID, Timestamp, etc.)
  • Add fuzz tests for edge case discovery using Go's native fuzzing
  • Add shared test fixtures and fixture loader utility

Test plan

  • All 129 tests pass on mongo4, mongo8, and documentdb
  • Fuzz tests run without panics
  • Linter passes with 0 issues

🤖 Generated with Claude Code

- 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]>
Copilot AI review requested due to automatic review settings January 23, 2026 06:27
Copy link

Copilot AI left a 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]>
@h3n4l h3n4l force-pushed the vk/5470-new-mongodb-quer branch from 010cb4f to 3c78f66 Compare January 23, 2026 06:43
@h3n4l h3n4l merged commit 5e3ae90 into main Jan 23, 2026
2 checks passed
@h3n4l h3n4l deleted the vk/5470-new-mongodb-quer branch January 23, 2026 06:45
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