Closed vikhyat90 closed 4 months ago
The changes introduce MongoDB support for integration tests by setting up a MongoDB container, adding test cases for MongoDB, and enhancing the MongoDB client interfaces and classes. This includes new methods for managing collections and documents, ensuring MongoDB functionality is thoroughly tested and integrated.
Files | Change Summary |
---|---|
src/Databases/IntegrationTests/DatabaseTests.Configure.cs |
Added MongoDB container setup for SupportedDatabase.Mongo in the StartEnvironmentForAsync method. |
src/Databases/IntegrationTests/DatabaseTests.cs |
Added [TestCase(SupportedDatabase.Mongo)] to several test methods to support MongoDB testing. |
src/Databases/Mongo/src/Client/IMongoContext.cs |
Added GetCollections() and GetDatabase() methods to the IMongoContext interface. |
src/Databases/Mongo/src/Client/IMongoDbClient.cs |
Added methods for collection existence, creation, deletion, retrieval, and document filtering to the IMongoDbClient interface. |
src/Databases/Mongo/src/Client/MongoContext.cs |
Added new methods and changed _mongoDatabase field to public for database and collection management. |
src/Databases/Mongo/src/Client/MongoDbClient.cs |
Added imports and new methods for managing MongoDB collections and checking their existence. |
src/Databases/Mongo/src/MongoVectorDatabase.cs |
Introduced MongoVectorDatabase class with methods for managing vector collections in MongoDB. |
sequenceDiagram
participant Test as Integration Test
participant Env as StartEnvironmentForAsync
participant MongoDB as MongoDB Container
participant MongoVectorDB as MongoVectorDatabase
Test->>Env: Start MongoDB environment
Env->>MongoDB: Initialize and start container
MongoDB-->>Env: Container started
Env->>MongoVectorDB: Create MongoVectorDatabase instance
MongoVectorDB-->>Env: Instance created
Env-->>Test: Environment ready
Test->>MongoVectorDB: Perform tests (e.g., CreateCollection, AddDocuments)
MongoVectorDB->>MongoDB: Interact with MongoDB collections
MongoDB-->>MongoVectorDB: Return results
MongoVectorDB-->>Test: Test results
In the land of code, a change so grand,
MongoDB joins the testing band.
Collections created, documents stored,
With seamless flow, new paths explored.
🐇✨ In databases vast, we now expand,
With Mongo's might, our tests withstand!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
MongoVectorDatabase
class for handling vector collections in MongoDB.Tests
Enhancements