Implement a mock implementation of mongot, written in C++ and reusing as much existing server source code as possible. This will allow integration testing of the internal mongotRemote aggregation stage without pulling other dependencies into the server codebase. The mock mongot should run as a standalone server process which responds to OP_MSG requests. Instead of performing real query execution, however, it can return mock data in response to all requests. There can be a command to pre-populate the data that the mongot mock should return on the next request.
Original description
Think through and implement tests for $mongotRemote, particularly on how to exercise functionality that communicates with mongot.
From a conversation with david.storch, these are ways we could potentially implement these:
- Implement unit tests and mock network responses from mongot.
- Look at async_results_merger_test and how it uses the ResultsMergerTestFixture
- This is the most lightweight of these listed options
- This seems like the most desirable option
- (Chosen) Implement integration tests and a suite in SERVER to mock mongot
- This seems like significantly more work than option (1)
- TODO for me - take a harder look at what this entails
- Implement integration tests with an actual running mongot
- Running these tests would be resource intensive
- This introduces a cross-project dependency
- TODO for me - take a harder look at what this entails
(Update) We have decided to move forward with option 2: implement integration tests and a suite in SERVER to mock mongot.
- depends on
-
SERVER-39447 $mongotRemote Implementation Work
- Closed