diff --git a/pymongo_inmemory/context.py b/pymongo_inmemory/context.py index a1c0639..fbd6824 100644 --- a/pymongo_inmemory/context.py +++ b/pymongo_inmemory/context.py @@ -127,6 +127,7 @@ def __init__( ) self.archive_folder = mkdir_ifnot_exist(self.download_folder, self.url_hash) self.extracted_folder = mkdir_ifnot_exist(self.extract_folder, self.url_hash) + self.storage_engine = "ephemeralForTest" def __str__(self): return ( @@ -143,6 +144,7 @@ def __str__(self): f"Use Local MongoD {self.use_local_mongod}\n" f"Download Folder {self.download_folder}\n" f"Extract Folder {self.extract_folder}\n" + f"Storage engine {self.storage_engine}\n" ) def _build_operating_system_info(self, os_name=None): @@ -152,14 +154,6 @@ def _build_operating_system_info(self, os_name=None): os_name = _mapping.get(platform.system()) if os_name is None: raise OperatingSystemNotFound("Can't determine operating system.") - else: - if os_name == "linux": - logger.warning( - ( - "Starting from MongoDB 4.0.23 " - "there isn't a generic Linux version of MongoDB" - ) - ) return os_name def _build_download_url(self): diff --git a/pymongo_inmemory/mongod.py b/pymongo_inmemory/mongod.py index dc9a00b..95503be 100644 --- a/pymongo_inmemory/mongod.py +++ b/pymongo_inmemory/mongod.py @@ -51,7 +51,7 @@ class MongodConfig: def __init__(self, pim_context: Context): self._pim_context = pim_context self.local_address = "127.0.0.1" - self.engine = "ephemeralForTest" + self.engine = pim_context.storage_engine @property def port(self): @@ -135,9 +135,10 @@ def start(self): self.config.port, "--bind_ip", self.config.local_address, - "--storageEngine", - self.config.engine, ] + if self.config.engine is not None: + boot_command.append("--storageEngine") + boot_command.append(self.config.engine) logger.debug(boot_command) self._proc = subprocess.Popen(boot_command) _popen_objs.append(self._proc)