Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40033

Implement mock mongot for testing



    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.12
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Epic Link:
    • Sprint:
      Query 2019-05-20


      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.


          Issue Links



              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: