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

Implement mock mongot for testing

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.12
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible
    • 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.

            Assignee:
            ian.boros@mongodb.com Ian Boros
            Reporter:
            evan.nixon@mongodb.com Evan Nixon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: