summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2020-04-21 13:51:15 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-24 23:28:50 +0000
commitaf0830d79c4c008b6671a4438e5dd7e2d358f5b3 (patch)
treeba09064d17c7c133d110480cbb01db0fe4b94051 /buildscripts
parent490f9b342ad028fb5b86172c8fa7d2e05032139d (diff)
downloadmongo-af0830d79c4c008b6671a4438e5dd7e2d358f5b3.tar.gz
SERVER-43335 Ingest drivers server selection tests
(cherry picked from commit 76823e76d597b52e66539580474c93be02fe2c6e)
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokeconfig/suites/sdam_json_test.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/server_selection_json_test.yml7
-rw-r--r--buildscripts/resmokelib/selector.py1
-rw-r--r--buildscripts/resmokelib/testing/testcases/sdam_json_test.py2
-rw-r--r--buildscripts/resmokelib/testing/testcases/server_selection_json_test.py49
5 files changed, 59 insertions, 2 deletions
diff --git a/buildscripts/resmokeconfig/suites/sdam_json_test.yml b/buildscripts/resmokeconfig/suites/sdam_json_test.yml
index f45af248956..0c55c0256b8 100644
--- a/buildscripts/resmokeconfig/suites/sdam_json_test.yml
+++ b/buildscripts/resmokeconfig/suites/sdam_json_test.yml
@@ -2,6 +2,6 @@ test_kind: sdam_json_test
selector:
roots:
- - src/mongo/client/sdam/json_tests/**/*.json
+ - src/mongo/client/sdam/json_tests/sdam_tests/**/*.json
executor: {}
diff --git a/buildscripts/resmokeconfig/suites/server_selection_json_test.yml b/buildscripts/resmokeconfig/suites/server_selection_json_test.yml
new file mode 100644
index 00000000000..77c0710cef5
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/server_selection_json_test.yml
@@ -0,0 +1,7 @@
+test_kind: server_selection_json_test
+
+selector:
+ roots:
+ - src/mongo/client/sdam/json_tests/server_selection_tests/**/*.json
+
+executor: {}
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
index faa60039e48..ac731ba8066 100644
--- a/buildscripts/resmokelib/selector.py
+++ b/buildscripts/resmokelib/selector.py
@@ -694,6 +694,7 @@ _SELECTOR_REGISTRY = {
"cpp_unit_test": (_CppTestSelectorConfig, _CppTestSelector),
"benchmark_test": (_CppTestSelectorConfig, _CppTestSelector),
"sdam_json_test": (_FileBasedSelectorConfig, _Selector),
+ "server_selection_json_test": (_FileBasedSelectorConfig, _Selector),
"db_test": (_DbTestSelectorConfig, _DbTestSelector),
"fsm_workload_test": (_JSTestSelectorConfig, _JSTestSelector),
"parallel_fsm_workload_test": (_MultiJSTestSelectorConfig, _MultiJSTestSelector),
diff --git a/buildscripts/resmokelib/testing/testcases/sdam_json_test.py b/buildscripts/resmokelib/testing/testcases/sdam_json_test.py
index 19d364c15d5..d998423803f 100644
--- a/buildscripts/resmokelib/testing/testcases/sdam_json_test.py
+++ b/buildscripts/resmokelib/testing/testcases/sdam_json_test.py
@@ -14,7 +14,7 @@ class SDAMJsonTestCase(interface.ProcessTestCase):
REGISTERED_NAME = "sdam_json_test"
EXECUTABLE_BUILD_PATH = "build/**/mongo/client/sdam/sdam_json_test"
- TEST_DIR = os.path.normpath("src/mongo/client/sdam/json_tests")
+ TEST_DIR = os.path.normpath("src/mongo/client/sdam/json_tests/sdam_tests")
def __init__(self, logger, json_test_file, program_options=None):
"""Initialize the TestCase with the executable to run."""
diff --git a/buildscripts/resmokelib/testing/testcases/server_selection_json_test.py b/buildscripts/resmokelib/testing/testcases/server_selection_json_test.py
new file mode 100644
index 00000000000..9a739ae5740
--- /dev/null
+++ b/buildscripts/resmokelib/testing/testcases/server_selection_json_test.py
@@ -0,0 +1,49 @@
+"""The unittest.TestCase for Server Selection JSON tests."""
+import os
+import os.path
+from . import interface
+from ... import core
+from ... import config
+from ... import utils
+from ...utils import globstar
+from ... import errors
+
+
+class ServerSelectionJsonTestCase(interface.ProcessTestCase):
+ """Server Selection JSON test case."""
+
+ REGISTERED_NAME = "server_selection_json_test"
+ EXECUTABLE_BUILD_PATH = "build/**/mongo/client/sdam/server_selection_json_test"
+ TEST_DIR = os.path.normpath("src/mongo/client/sdam/json_tests/server_selection_tests")
+
+ def __init__(self, logger, json_test_file, program_options=None):
+ """Initialize the TestCase with the executable to run."""
+ interface.ProcessTestCase.__init__(self, logger, "Server Selection Json Test",
+ json_test_file)
+
+ self.program_executable = self._find_executable()
+ self.json_test_file = os.path.normpath(json_test_file)
+ self.program_options = utils.default_if_none(program_options, {}).copy()
+
+ def _find_executable(self):
+ if config.INSTALL_DIR is not None:
+ binary = os.path.join(config.INSTALL_DIR, "server_selection_json_test")
+ if os.name == "nt":
+ binary += ".exe"
+
+ if os.path.isfile(binary):
+ return binary
+
+ execs = globstar.glob(self.EXECUTABLE_BUILD_PATH + '.exe')
+ if not execs:
+ execs = globstar.glob(self.EXECUTABLE_BUILD_PATH)
+ if len(execs) != 1:
+ raise errors.StopExecution(
+ "There must be a single server_selection_json_test binary in {}".format(execs))
+ return execs[0]
+
+ def _make_process(self):
+ command_line = [self.program_executable]
+ command_line += ["--source-dir", self.TEST_DIR]
+ command_line += ["-f", self.json_test_file]
+ return core.programs.make_process(self.logger, command_line)