summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2017-05-26 10:28:42 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2017-05-26 10:30:41 -0400
commit68b0d672078f4c3041a25cebb9843b00de20f198 (patch)
tree819380383f09b7ced181deabe7df4fd5371fa313 /buildscripts/resmokelib
parentfe2046a0eb715cec4d978454458f79b7588ee7a7 (diff)
downloadmongo-68b0d672078f4c3041a25cebb9843b00de20f198.tar.gz
SERVER-29306 Prevent C++ unit, integration and dbtests from running twice during patch builds
Diffstat (limited to 'buildscripts/resmokelib')
-rw-r--r--buildscripts/resmokelib/selector.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
index f1b53e9d877..30cc2d1b31d 100644
--- a/buildscripts/resmokelib/selector.py
+++ b/buildscripts/resmokelib/selector.py
@@ -51,11 +51,30 @@ def _parse_tag_file(test_kind):
return tagged_tests
+def _tags_from_list(tags):
+ """
+ Returns list of tags from tag list.
+ Each tag in the list may be a list of comma separated tags, with empty strings ignored.
+ """
+
+ if tags is not None:
+ for tag in tags:
+ return [t for t in tag.split(",") if t != ""]
+ return []
+
+
def _filter_cpp_tests(kind, root, include_files, exclude_files):
"""
Generic filtering logic for C++ tests that are sourced from a list
of test executables.
"""
+
+ # TODO: SERVER-22170 Implement full tagging support
+ # If --includeWithAnyTags is supplied, then no tests should be run since
+ # C++ tests cannot be tagged.
+ if _tags_from_list(config.INCLUDE_WITH_ANY_TAGS):
+ return []
+
include_files = utils.default_if_none(include_files, [])
exclude_files = utils.default_if_none(exclude_files, [])
@@ -91,6 +110,12 @@ def filter_dbtests(binary=None, include_suites=None):
Filters out what dbtests to run.
"""
+ # TODO: SERVER-22170 Implement full tagging support
+ # If --includeWithAnyTags is supplied, then no tests should be run since
+ # dbtests tests cannot be tagged.
+ if _tags_from_list(config.INCLUDE_WITH_ANY_TAGS):
+ return []
+
# Command line option overrides the YAML configuration.
binary = utils.default_if_none(config.DBTEST_EXECUTABLE, binary)
# Use the default if nothing specified.
@@ -166,7 +191,7 @@ def filter_jstests(roots,
# command line has no effect and allows a user to more easily synthesize a resmoke.py
# invocation in their Evergreen project configuration.
for cmd_line_tags in cmd_line_list:
- tags[tag_category] |= set(tag for tag in cmd_line_tags.split(",") if tag != "")
+ tags[tag_category] |= set(_tags_from_list([cmd_line_tags]))
jstests_list = []
for root in roots: