diff options
author | Richard Samuels <richard.l.samuels@gmail.com> | 2022-04-18 14:36:00 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-20 15:16:36 +0000 |
commit | adfd03d5eb008910ceabc5bd62aaa50da6aca1ef (patch) | |
tree | ec56a9a7d5240d48cec485568f8223e2438d4cb9 | |
parent | 20ee2db68fa0e1fdc205fda76757700ede015659 (diff) | |
download | mongo-adfd03d5eb008910ceabc5bd62aaa50da6aca1ef.tar.gz |
SERVER-62992 Don't validate resmoke.ini and install_dir when using subcommands other than run
(cherry picked from commit a4aa57a45b9c730acc0a888d0b86a479423ffe87)
-rw-r--r-- | buildscripts/idl/check_stable_api_commands_have_idl_definitions.py | 1 | ||||
-rw-r--r-- | buildscripts/resmokelib/configure_resmoke.py | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/buildscripts/idl/check_stable_api_commands_have_idl_definitions.py b/buildscripts/idl/check_stable_api_commands_have_idl_definitions.py index af3fe729ab7..c18077ace76 100644 --- a/buildscripts/idl/check_stable_api_commands_have_idl_definitions.py +++ b/buildscripts/idl/check_stable_api_commands_have_idl_definitions.py @@ -178,6 +178,7 @@ def main(): def __init__(self): self.INSTALL_DIR = args.install_dir # pylint: disable=invalid-name + self.command = "" # pylint: disable=protected-access configure_resmoke._update_config_vars(FakeArgs()) diff --git a/buildscripts/resmokelib/configure_resmoke.py b/buildscripts/resmokelib/configure_resmoke.py index f5f9123f1f1..088620a57bd 100644 --- a/buildscripts/resmokelib/configure_resmoke.py +++ b/buildscripts/resmokelib/configure_resmoke.py @@ -146,7 +146,7 @@ def _find_resmoke_wrappers(): # We assume that users who fall under either case will explicitly pass the # --installDir argument. candidate_installs = glob.glob("**/bin/resmoke.py", recursive=True) - return list(map(os.path.dirname, candidate_installs)) + return list(candidate_installs) def _update_config_vars(values): # pylint: disable=too-many-statements,too-many-locals,too-many-branches @@ -163,7 +163,7 @@ def _update_config_vars(values): # pylint: disable=too-many-statements,too-many if cmdline_vars[cmdline_key] is not None: config[cmdline_key] = cmdline_vars[cmdline_key] - if os.path.isfile("resmoke.ini"): + if values.command == "run" and os.path.isfile("resmoke.ini"): err = textwrap.dedent("""\ Support for resmoke.ini has been removed. You must delete resmoke.ini and rerun your build to run resmoke. If only one testable @@ -254,10 +254,10 @@ be invoked as either: _config.MULTIVERSION_BIN_VERSION = config.pop("old_bin_version") _config.INSTALL_DIR = config.pop("install_dir") - if _config.INSTALL_DIR is None: + if values.command == "run" and _config.INSTALL_DIR is None: resmoke_wrappers = _find_resmoke_wrappers() if len(resmoke_wrappers) == 1: - _config.INSTALL_DIR = resmoke_wrappers[0] + _config.INSTALL_DIR = os.path.dirname(resmoke_wrappers[0]) elif len(resmoke_wrappers) > 1: err = textwrap.dedent(f"""\ Multiple testable installations were found, but installDir was not specified. |