Create helpers for $search mongotmock test files

XMLWordPrintableJSON

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

      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
            Reporter:
            Erin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: