summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/fixtures/interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/resmokelib/testing/fixtures/interface.py')
-rw-r--r--buildscripts/resmokelib/testing/fixtures/interface.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/interface.py b/buildscripts/resmokelib/testing/fixtures/interface.py
index f2cb1b9c8b8..5da95175008 100644
--- a/buildscripts/resmokelib/testing/fixtures/interface.py
+++ b/buildscripts/resmokelib/testing/fixtures/interface.py
@@ -4,12 +4,16 @@ Interface of the different fixtures for executing JSTests against.
from __future__ import absolute_import
+import os.path
import time
import pymongo
+import pymongo.errors
+from ... import config
from ... import errors
from ... import logging
+from ... import utils
class Fixture(object):
@@ -17,7 +21,7 @@ class Fixture(object):
Base class for all fixtures.
"""
- def __init__(self, logger, job_num):
+ def __init__(self, logger, job_num, dbpath_prefix=None):
"""
Initializes the fixture with a logger instance.
"""
@@ -32,9 +36,12 @@ class Fixture(object):
self.logger = logger
self.job_num = job_num
-
self.port = None # Port that the mongo shell should connect to.
+ dbpath_prefix = utils.default_if_none(config.DBPATH_PREFIX, dbpath_prefix)
+ dbpath_prefix = utils.default_if_none(dbpath_prefix, config.DEFAULT_DBPATH_PREFIX)
+ self._dbpath_prefix = os.path.join(dbpath_prefix, "job{}".format(self.job_num))
+
def setup(self):
"""
Creates the fixture.
@@ -79,6 +86,9 @@ class Fixture(object):
"""
return True
+ def get_dbpath_prefix(self):
+ return self._dbpath_prefix
+
def get_internal_connection_string(self):
"""
Returns the connection string for this fixture. This is NOT a