summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorLamont Nelson <lamont.nelson@mongodb.com>2019-11-27 17:40:41 +0000
committerevergreen <evergreen@mongodb.com>2019-11-27 17:40:41 +0000
commit25d1843463882eb36d14c58fe5234c5f5f852e1d (patch)
treeec7280798cf8f3cd609beffbd989f649ad8a33e0 /buildscripts
parentb9d2e2edb9f241dde807c29509b46417085e5ebb (diff)
downloadmongo-25d1843463882eb36d14c58fe5234c5f5f852e1d.tar.gz
SERVER-43333 Ingest driver SDAM tests
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokeconfig/suites/sdam_json_test.yml7
-rw-r--r--buildscripts/resmokelib/selector.py1
-rw-r--r--buildscripts/resmokelib/testing/testcases/sdam_json_test.py39
3 files changed, 47 insertions, 0 deletions
diff --git a/buildscripts/resmokeconfig/suites/sdam_json_test.yml b/buildscripts/resmokeconfig/suites/sdam_json_test.yml
new file mode 100644
index 00000000000..f45af248956
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/sdam_json_test.yml
@@ -0,0 +1,7 @@
+test_kind: sdam_json_test
+
+selector:
+ roots:
+ - src/mongo/client/sdam/json_tests/**/*.json
+
+executor: {}
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
index 35e094084c7..497266c1711 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),
"benchrun_embedded_test": (_FileBasedSelectorConfig, _Selector),
+ "sdam_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
new file mode 100644
index 00000000000..27c9e4e94ef
--- /dev/null
+++ b/buildscripts/resmokelib/testing/testcases/sdam_json_test.py
@@ -0,0 +1,39 @@
+"""The unittest.TestCase for Server Discovery and Monitoring JSON tests."""
+import os
+import os.path
+from . import interface
+from ... import core
+from ... import utils
+from ...utils import globstar
+from ... import errors
+
+
+class SDAMJsonTestCase(interface.ProcessTestCase):
+ """Server Discovery and Monitoring JSON test case."""
+
+ 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")
+
+ def __init__(self, logger, json_test_file, program_options=None):
+ """Initialize the TestCase with the executable to run."""
+ interface.ProcessTestCase.__init__(self, logger, "SDAM 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):
+ 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 sdam_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)