-
Type: Task
-
Resolution: Unresolved
-
Priority: 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(); }