summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMike Grundy <michael.grundy@10gen.com>2016-04-21 13:12:29 -0400
committerMike Grundy <michael.grundy@10gen.com>2016-05-16 12:33:27 -0400
commit08eff1fb0ffc846ed94a6b859779f2e7113a0877 (patch)
treee0e1f7753b43a253c1a96ee462eb08060a4573f6 /buildscripts
parent0e99416408f62276245216949b7eb93259ec1d5c (diff)
downloadmongo-08eff1fb0ffc846ed94a6b859779f2e7113a0877.tar.gz
SERVER-22198 resmoke.py should obey order of tests specified via command line
(cherry picked from commit e7e0ef104b8266d0dbd786c8bb4e8e8b77c8f0e6)
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/config.py7
-rw-r--r--buildscripts/resmokelib/parser.py7
-rw-r--r--buildscripts/resmokelib/testing/suite.py5
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):
"""