diff options
-rw-r--r-- | buildscripts/resmokelib/config.py | 7 | ||||
-rw-r--r-- | buildscripts/resmokelib/parser.py | 7 | ||||
-rw-r--r-- | buildscripts/resmokelib/testing/suite.py | 5 |
3 files changed, 18 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index ecb7fec7fa3..d19ca0181df 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -163,3 +163,10 @@ WT_ENGINE_CONFIG = None # If set, then all mongod's started by resmoke.py and by the mongo shell will use the specified # WiredTiger index configuration settings. WT_INDEX_CONFIG = None + +## +# Internally used configuration options that aren't exposed to the user +## + +# Default sort order for test execution. Will only be changed if --suites wasn't specified. +ORDER_TESTS_BY_NAME = True diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py index 4bcc7bfb137..c170e4c218d 100644 --- a/buildscripts/resmokelib/parser.py +++ b/buildscripts/resmokelib/parser.py @@ -258,6 +258,13 @@ def get_suites(values, args): # If there are no suites specified, but there are args, assume they are jstests. if args: + # Do not change the execution order of the jstests passed as args, unless a tag option is + # specified. If an option is specified, then sort the tests for consistent execution order. + _config.ORDER_TESTS_BY_NAME = any(tag_filter is not None for + tag_filter in (_config.EXCLUDE_WITH_ALL_TAGS, + _config.EXCLUDE_WITH_ANY_TAGS, + _config.INCLUDE_WITH_ALL_TAGS, + _config.INCLUDE_WITH_ANY_TAGS)) # No specified config, just use the following, and default the logging and executor. suite_config = _make_jstests_config(args) _ensure_executor(suite_config, values.executor_file) diff --git a/buildscripts/resmokelib/testing/suite.py b/buildscripts/resmokelib/testing/suite.py index 65503b85e8b..11777c0e12f 100644 --- a/buildscripts/resmokelib/testing/suite.py +++ b/buildscripts/resmokelib/testing/suite.py @@ -8,6 +8,7 @@ import time from . import summary as _summary from . import testgroup +from .. import config as _config from .. import selector as _selector @@ -63,7 +64,9 @@ class Suite(object): else: # test_kind == "js_test": tests = _selector.filter_jstests(**test_info) - return sorted(tests, key=str.lower) + if _config.ORDER_TESTS_BY_NAME: + return sorted(tests, key=str.lower) + return tests def get_name(self): """ |