diff options
| author | Juan Gu <111318390+juangugit@users.noreply.github.com> | 2023-11-27 13:25:51 -0800 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-11-29 00:04:38 +0000 |
| commit | f05aab4ac9504884ac5a085bd890a6d586e754d8 (patch) | |
| tree | 7ac6382eafb574197abc0e7428cc615e8a2608a0 | |
| parent | 05a36cbeb1a53962e3abfb5008078f6314caed17 (diff) | |
SERVER-83592 Add resmoke flag --enable_enterprise_tests enable enterprise js testsr7.2.0-rc2
(cherry picked from commit d463d338460a26792c33e173c7cd475535842812)
| -rw-r--r-- | buildscripts/resmokelib/config.py | 1 | ||||
| -rw-r--r-- | buildscripts/resmokelib/configure_resmoke.py | 1 | ||||
| -rw-r--r-- | buildscripts/resmokelib/run/__init__.py | 5 | ||||
| -rw-r--r-- | buildscripts/resmokelib/selector.py | 17 |
4 files changed, 24 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index 841b7caa732..058620609b0 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -105,6 +105,7 @@ DEFAULTS = { "shuffle": None, "stagger_jobs": None, "majority_read_concern": "on", + "enable_enterprise_tests": None, "shell_seed": None, "storage_engine": "wiredTiger", "storage_engine_cache_size_gb": None, diff --git a/buildscripts/resmokelib/configure_resmoke.py b/buildscripts/resmokelib/configure_resmoke.py index 47259bd30bf..c0ffddec097 100644 --- a/buildscripts/resmokelib/configure_resmoke.py +++ b/buildscripts/resmokelib/configure_resmoke.py @@ -321,6 +321,7 @@ be invoked as either: _config.JOBS = config.pop("jobs") _config.LINEAR_CHAIN = config.pop("linear_chain") == "on" _config.MAJORITY_READ_CONCERN = config.pop("majority_read_concern") == "on" + _config.ENABLE_ENTERPRISE_TESTS = config.pop("enable_enterprise_tests") _config.MIXED_BIN_VERSIONS = config.pop("mixed_bin_versions") if _config.MIXED_BIN_VERSIONS is not None: _config.MIXED_BIN_VERSIONS = _config.MIXED_BIN_VERSIONS.split("-") diff --git a/buildscripts/resmokelib/run/__init__.py b/buildscripts/resmokelib/run/__init__.py index 1aa90e8e3e6..7c44b85e050 100644 --- a/buildscripts/resmokelib/run/__init__.py +++ b/buildscripts/resmokelib/run/__init__.py @@ -1106,6 +1106,11 @@ class RunPlugin(PluginInterface): metavar="ON|OFF", help=("Enable or disable majority read concern support." " Defaults to %(default)s.")) + mongodb_server_options.add_argument( + "--enableEnterpriseTests", action="store", dest="enable_enterprise_tests", default="on", + choices=("on", "off"), metavar="ON|OFF", + help=("Enable or disable enterprise tests. Defaults to 'on'.")) + mongodb_server_options.add_argument("--flowControl", action="store", dest="flow_control", choices=("on", "off"), metavar="ON|OFF", help=("Enable or disable flow control.")) diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py index 3b29d5ee0a4..6e9af1fdaf3 100644 --- a/buildscripts/resmokelib/selector.py +++ b/buildscripts/resmokelib/selector.py @@ -20,6 +20,8 @@ from buildscripts.resmokelib import utils from buildscripts.resmokelib.utils import globstar from buildscripts.resmokelib.utils import jscomment +ENTERPRISE_TEST_DIR = os.path.normpath("src/mongo/db/modules/enterprise/jstests") + ######################## # Test file explorer # ######################## @@ -272,6 +274,13 @@ class _TestList(object): for path in paths.evaluated: self._filtered.discard(path) + def filter_enterprise_tests(self): + """Exclude tests that start with the enterprise module directory from the test list.""" + self._filtered = { + test + for test in self._filtered if not os.path.normpath(test).startswith(ENTERPRISE_TEST_DIR) + } + def match_tag_expression(self, tag_expression, get_tags): """Filter the test list to only include tests that match the tag expression. @@ -511,6 +520,9 @@ class _Selector(object): # 5. Apply the include files last with force=True to take precedence over the tags. if self._tests_are_files and selector_config.include_files: test_list.include_files(selector_config.include_files) + # 6: Apply the enterprise tests filter + if self.get_enterprise_tests_status() == "off": + test_list.filter_enterprise_tests() return self.sort_tests(*test_list.get_tests()) @@ -526,6 +538,11 @@ class _Selector(object): """Retrieve the tags associated with the give test file.""" return [] + @staticmethod + def get_enterprise_tests_status() -> str: + """Get the status of enterprise tests from the configuration.""" + return config.ENABLE_ENTERPRISE_TESTS + class _JSTestSelectorConfig(_SelectorConfig): """_SelectorConfig subclass for JavaScript tests.""" |
