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

create MongoTFixture and and enable launching Mongot

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration

      First, a binary of mongot will need to be downloaded to your VM locally and standalone_search_end_to_end suite YML file will need to be created, in order to run a dummy test that launches a Mongot.

      After adding a launch_mongot option to the MongoDFixture, the yml file for the standalone_search_end_to_end should look like:

       

       fixture:
          class: MongoDFixture
          launch_mongot: true
      

       

       

      The constructor for the given MongoDFixture will set a flag, launch_mongot, on either self.mongod_options or self.mongos_options to indicate if a mongot process has been requested by the suite's enable_mongot parameter. MongoDFixture doesn't have a builder, so the MongoTFixture will be created and setup from MongoDFixture::setup().

       

      MongoTFixture::setup() will involve spawning a new mongot process via a new MongoTLauncher class. Like the MongoD and MongoS launchers, MongoTLauncher::launch_mongot_program will return a Process instance

       

      The Process class, which sets all the command line options before spinning up the server via the command line, can be used to also launch a mongot via the command line. The arg, self.args[0] will be the path to the mongot binary. 

      The other elements in the args list will include the keyFile path, as specified by the suite's YML definition, and the mongodHostAndPort value, localhost:<port> where <port> will be set by the port allocator. These command line options will be passed to subprocess.Popen, which will spawn and invoke the mongot process.

      The mongod process(es) will be launched as normal but now with a mongotHost startup option, the value of which will always be localhost:<port>. And in line with other jstests, the mongo shell will get the driver connection url of the mongod process (wrapped in a fixture) and use this to set global 'db' object that server e2e $search tests will use. In this way, the e2e tests will be immediately hooked up to a mongod that is connected to a real mongot.

            Assignee:
            maddie.zechar@mongodb.com Maddie Zechar
            Reporter:
            maddie.zechar@mongodb.com Maddie Zechar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: