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

Create helpers for $search mongotmock test files

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

      Mongotmock tests with mongod do some variant of the following to set up mongotmock and mongod.

      const mongotmock = new MongotMock();
      mongotmock.start();
      const mongotConn = mongotmock.getConnection();
      
      const conn = MongoRunner.runMongod({setParameter: {mongotHost: mongotConn.host}});
      const dbName = jsTestName();
      const db = conn.getDB(dbName);
      const coll = db.search;
      coll.drop();
      const collName = coll.getName();
      

      Create a helper to abstract this block away.

      Another thing that a helper function could be created for is exiting out of a test early if sbe is enabled.

      if (checkSbeRestrictedOrFullyEnabled(db) &&
          FeatureFlagUtil.isPresentAndEnabled(db.getMongo(), 'SearchInSbe')) {
          jsTestLog("Skipping the test because it only applies to $search in classic engine.");
          MongoRunner.stopMongod(conn);
          mongotmock.stop();
          quit();
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            erin.zhu@mongodb.com Erin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: