summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib
diff options
context:
space:
mode:
authorTrevor Guidry <trevor.guidry@mongodb.com>2023-04-10 21:09:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-10 22:25:02 +0000
commitae16cf75e35a7a6e0dc0da817044a55eaee3e9c1 (patch)
tree097836b15ee43416e0bdfeeb4996e697a197dc7d /buildscripts/resmokelib
parentba177ea4b9904830d54379cd5886c4b219504ff8 (diff)
downloadmongo-ae16cf75e35a7a6e0dc0da817044a55eaee3e9c1.tar.gz
SERVER-72924 add --shellSeed argument to resmoke
Diffstat (limited to 'buildscripts/resmokelib')
-rw-r--r--buildscripts/resmokelib/config.py4
-rw-r--r--buildscripts/resmokelib/configure_resmoke.py4
-rw-r--r--buildscripts/resmokelib/core/programs.py3
-rw-r--r--buildscripts/resmokelib/run/__init__.py5
4 files changed, 16 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
index 7ec8e0d4947..35758398781 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -104,6 +104,7 @@ DEFAULTS = {
"shuffle": None,
"stagger_jobs": None,
"majority_read_concern": "on",
+ "shell_seed": None,
"storage_engine": "wiredTiger",
"storage_engine_cache_size_gb": None,
"suite_files": "with_server",
@@ -462,6 +463,9 @@ SERVICE_EXECUTOR = None
# connection string instead.
SHELL_CONN_STRING = None
+# If set, resmoke will override the random seed for jstests.
+SHELL_SEED = None
+
# If true, then the order the tests run in is randomized. Otherwise the tests will run in
# alphabetical (case-insensitive) order.
SHUFFLE = None
diff --git a/buildscripts/resmokelib/configure_resmoke.py b/buildscripts/resmokelib/configure_resmoke.py
index 786483edd51..6e5c4705a55 100644
--- a/buildscripts/resmokelib/configure_resmoke.py
+++ b/buildscripts/resmokelib/configure_resmoke.py
@@ -53,6 +53,9 @@ def _validate_options(parser, args):
"Cannot use --replayFile with additional test files listed on the command line invocation."
)
+ if args.shell_seed and (not args.test_files or len(args.test_files) != 1):
+ parser.error("The --shellSeed argument must be used with only one test.")
+
if args.additional_feature_flags_file and not os.path.isfile(
args.additional_feature_flags_file):
parser.error("The specified additional feature flags file does not exist.")
@@ -336,6 +339,7 @@ or explicitly pass --installDir to the run subcommand of buildscripts/resmoke.py
_config.REPORT_FILE = config.pop("report_file")
_config.SERVICE_EXECUTOR = config.pop("service_executor")
_config.EXPORT_MONGOD_CONFIG = config.pop("export_mongod_config")
+ _config.SHELL_SEED = config.pop("shell_seed")
_config.STAGGER_JOBS = config.pop("stagger_jobs") == "on"
_config.STORAGE_ENGINE = config.pop("storage_engine")
_config.STORAGE_ENGINE_CACHE_SIZE = config.pop("storage_engine_cache_size_gb")
diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py
index c860bb25a03..a82383f1958 100644
--- a/buildscripts/resmokelib/core/programs.py
+++ b/buildscripts/resmokelib/core/programs.py
@@ -195,6 +195,9 @@ def mongo_shell_program(logger, executable=None, connection_string=None, filenam
test_data["inEvergreen"] = True
test_data["evergreenTaskId"] = config.EVERGREEN_TASK_ID
+ if config.SHELL_SEED is not None:
+ test_data["seed"] = int(config.SHELL_SEED)
+
# Initialize setParameters for mongod and mongos, to be passed to the shell via TestData. Since
# they are dictionaries, they will be converted to JavaScript objects when passed to the shell
# by the _format_shell_vars() function.
diff --git a/buildscripts/resmokelib/run/__init__.py b/buildscripts/resmokelib/run/__init__.py
index 956265a525e..6dbe936a362 100644
--- a/buildscripts/resmokelib/run/__init__.py
+++ b/buildscripts/resmokelib/run/__init__.py
@@ -753,6 +753,11 @@ class RunPlugin(PluginInterface):
parser.set_defaults(logger_file="console")
parser.add_argument(
+ "--shellSeed", action="store", dest="shell_seed", default=None,
+ help=("Sets the seed for replset and sharding fixtures to use. "
+ "This only works when only one test is input into resmoke."))
+
+ parser.add_argument(
"--mongocryptdSetParameters", dest="mongocryptd_set_parameters", action="append",
metavar="{key1: value1, key2: value2, ..., keyN: valueN}",
help=("Passes one or more --setParameter options to all mongocryptd processes"