[SERVER-40033] Implement mock mongot for testing Created: 07/Mar/19  Updated: 29/Oct/23  Resolved: 13/May/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.1.12

Type: Task Priority: Major - P3
Reporter: Evan Nixon Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: FTS
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-39447 $mongotRemote Implementation Work Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-05-20
Participants:

 Description   

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:

  1. Implement unit tests and mock network responses from mongot.
  2. (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
  3. 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.



 Comments   
Comment by Githook User [ 13/May/19 ]

Author:

{'email': 'puppyofkosh@gmail.com', 'name': 'Ian Boros', 'username': 'puppyofkosh'}

Message: SERVER-40033 declare MongotMockState methods const
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/34ea2fd6289da4c44bcdfafcbdee2601615cc4fe

Comment by Githook User [ 13/May/19 ]

Author:

{'email': 'puppyofkosh@gmail.com', 'name': 'Ian Boros', 'username': 'puppyofkosh'}

Message: SERVER-40033 Add mongotmock
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/f457aab41a2e90bd45d1ba2f9d4cf89afe013b97

Comment by David Storch [ 03/Apr/19 ]

evan.nixon, yep, seems reasonable. I made some additional edits to the title and description of the ticket in order to clarify the plan.

Comment by Evan Nixon [ 28/Mar/19 ]

david.storch yes that seems right to me, do those updates look OK to you?

I agree that we should break that work down, but I think it makes sense to wait on that until we have a concrete plan for communication between mongod and mongot. I'd like to flesh this ticket out more too after things settle if that makes sense to you.

Comment by David Storch [ 28/Mar/19 ]

evan.nixon I believe we decided on option 2: building a mock mongot for integration testing in the server repository. Can you update the ticket accordingly? Also, presumably we should break down the work of writing the mock into multiple work items?

Generated at Thu Feb 08 04:53:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.