diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2019-12-18 23:44:10 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-12-18 23:44:10 +0000 |
commit | 78c3875c67edced8df4b685a53137ec51942688f (patch) | |
tree | 8f25ec642ae9467e0099593b1ea3d7a396e3a370 /buildscripts | |
parent | cf4daadf45ced157fd347480f046f8b5a58f05fa (diff) | |
download | mongo-78c3875c67edced8df4b685a53137ec51942688f.tar.gz |
SERVER-45062 Add evergreen builder for JSON log format
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/resmokelib/config.py | 5 | ||||
-rw-r--r-- | buildscripts/resmokelib/core/programs.py | 8 | ||||
-rw-r--r-- | buildscripts/resmokelib/parser.py | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index a15c4265121..de29f76d872 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -61,6 +61,7 @@ DEFAULTS = { "include_with_any_tags": None, "install_dir": None, "jobs": 1, + "log_format": None, "mongo_executable": None, "mongod_executable": None, "mongod_set_parameters": None, @@ -312,6 +313,10 @@ MONGOD_EXECUTABLE = None # The --setParameter options passed to mongod. MONGOD_SET_PARAMETERS = None +# If set, the log format to use by all mongod's and mongo shells started by resmoke.py +# Supported values are the same as what is supported in mongod/mongo shell: default, text, json +LOG_FORMAT = None + # The path to the mongos executable used by resmoke.py. MONGOS_EXECUTABLE = None diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py index 36cc68f48f2..0b231dbd4ae 100644 --- a/buildscripts/resmokelib/core/programs.py +++ b/buildscripts/resmokelib/core/programs.py @@ -138,6 +138,7 @@ def mongod_program( # pylint: disable=too-many-branches shortcut_opts = { "enableMajorityReadConcern": config.MAJORITY_READ_CONCERN, + "logFormat": config.LOG_FORMAT, "nojournal": config.NO_JOURNAL, "serviceExecutor": config.SERVICE_EXECUTOR, "storageEngine": config.STORAGE_ENGINE, @@ -213,6 +214,9 @@ def mongos_program(logger, executable=None, process_kwargs=None, **kwargs): _apply_set_parameters(args, suite_set_parameters) + if config.LOG_FORMAT is not None: + kwargs["logFormat"] = config.LOG_FORMAT + # Apply the rest of the command line arguments. _apply_kwargs(args, kwargs) @@ -243,6 +247,7 @@ def mongo_shell_program( # pylint: disable=too-many-branches,too-many-locals,to test_name = None shortcut_opts = { "enableMajorityReadConcern": (config.MAJORITY_READ_CONCERN, True), + "logFormat": (config.LOG_FORMAT, ""), "mixedBinVersions": (config.MIXED_BIN_VERSIONS, ""), "noJournal": (config.NO_JOURNAL, False), "serviceExecutor": (config.SERVICE_EXECUTOR, ""), @@ -354,6 +359,9 @@ def mongo_shell_program( # pylint: disable=too-many-branches,too-many-locals,to if "host" in kwargs: kwargs.pop("host") + if config.LOG_FORMAT is not None: + kwargs["logFormat"] = config.LOG_FORMAT + # Apply the rest of the command line arguments. _apply_kwargs(args, kwargs) diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py index fce3b60acec..daff8aab62a 100644 --- a/buildscripts/resmokelib/parser.py +++ b/buildscripts/resmokelib/parser.py @@ -138,6 +138,9 @@ def _make_parser(): # pylint: disable=too-many-statements " started by resmoke.py. The argument is specified as bracketed YAML -" " i.e. JSON with support for single quoted and unquoted keys.")) + parser.add_option("--logFormat", dest="log_format", + help="The log format used by mongo executables.") + parser.add_option("--mongos", dest="mongos_executable", metavar="PATH", help="The path to the mongos executable for resmoke.py to use.") @@ -600,6 +603,7 @@ def _update_config_vars(values): # pylint: disable=too-many-statements,too-many _config.GENNY_EXECUTABLE = _expand_user(config.pop("genny_executable")) _config.JOBS = config.pop("jobs") _config.LINEAR_CHAIN = config.pop("linear_chain") == "on" + _config.LOG_FORMAT = config.pop("log_format") _config.MAJORITY_READ_CONCERN = config.pop("majority_read_concern") == "on" _config.MIXED_BIN_VERSIONS = config.pop("mixed_bin_versions") if _config.MIXED_BIN_VERSIONS is not None: |