Skip to content

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Jan 21, 2026

Summary

  • Add singleton test container for faster test execution
  • Split tests by domain (collection, database, error)
  • Create internal/translator and internal/executor packages
  • Simplify main package to thin wrapper

Test plan

  • All tests pass with go test -v ./...
  • Tests pass with race detection go test -race ./...
  • Linter passes golangci-lint run

🤖 Generated with Claude Code

Testing improvements:
- Add singleton test container (internal/testutil) for faster test execution
- Split executor_test.go into domain-specific files:
  - collection_test.go: find, findOne, aggregate, count, distinct, indexes
  - database_test.go: show commands, getCollectionNames, getCollectionInfos
  - error_test.go: parse errors, unsupported operations
- Use human-readable database names (e.g., testdb_find_docs)

Code organization:
- Create internal/translator package for parsing logic
- Create internal/executor package for execution logic
- Simplify main package to thin wrapper delegating to internal packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 21, 2026 08:57
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

This PR refactors the codebase to improve testing infrastructure and organize code by domain. The changes move translator and executor logic into internal packages while maintaining backward compatibility through thin public wrappers. The test infrastructure is enhanced with a singleton test container pattern for faster test execution.

Changes:

  • Added singleton test container (internal/testutil) to reuse MongoDB containers across tests
  • Split code into domain-specific internal packages: internal/translator (parsing), internal/executor (execution), and further split by collection/database/server operations
  • Refactored main package (translator.go, executor.go) into thin wrappers that delegate to internal packages

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
translator.go Deleted - code moved to internal/translator package
method_registry.go Replaced with backward compatibility comment
internal/translator/*.go New translator package with domain-split files (visitor, types, collection, database, errors, etc.)
internal/executor/*.go New executor package split by domain (executor, collection, database, server)
internal/testutil/container.go New singleton test container for improved test performance
executor.go Refactored to thin wrapper delegating to internal/executor
errors.go Added wrapper functions for backward compatibility
*_test.go Updated to use shared test container and unique database names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@h3n4l h3n4l merged commit 4d0ac79 into main Jan 21, 2026
8 checks passed
@h3n4l h3n4l deleted the vk/e114-improve-testing branch January 21, 2026 09:53
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