2020-05-13 14:35:29 -04:00
|
|
|
"""Command-line entry-point into resmoke."""
|
|
|
|
|
|
2022-07-14 09:48:13 -05:00
|
|
|
import os
|
2024-10-10 10:59:18 -07:00
|
|
|
import time
|
|
|
|
|
|
2022-07-14 09:48:13 -05:00
|
|
|
import psutil
|
2024-10-10 10:59:18 -07:00
|
|
|
|
2020-05-13 14:35:29 -04:00
|
|
|
from buildscripts.resmokelib import parser
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(argv):
|
|
|
|
|
"""
|
|
|
|
|
Execute Main function for resmoke.
|
|
|
|
|
|
|
|
|
|
:param argv: sys.argv
|
|
|
|
|
:return: None
|
|
|
|
|
"""
|
|
|
|
|
__start_time = time.time()
|
2024-05-16 18:00:17 -04:00
|
|
|
os.environ["RESMOKE_PARENT_PROCESS"] = str(os.getpid())
|
|
|
|
|
os.environ["RESMOKE_PARENT_CTIME"] = str(psutil.Process().create_time())
|
2025-04-25 16:29:29 -04:00
|
|
|
|
|
|
|
|
# If invoked by "bazel run", ensure it runs in the workspace root.
|
|
|
|
|
workspace_dir = os.environ.get("BUILD_WORKSPACE_DIRECTORY")
|
|
|
|
|
if workspace_dir:
|
|
|
|
|
os.chdir(workspace_dir)
|
|
|
|
|
|
2021-02-18 17:18:35 -05:00
|
|
|
subcommand = parser.parse_command_line(
|
2024-05-16 18:00:17 -04:00
|
|
|
argv[1:],
|
|
|
|
|
start_time=__start_time,
|
2021-02-18 17:18:35 -05:00
|
|
|
usage="Resmoke is MongoDB's correctness testing orchestrator.\n"
|
|
|
|
|
"For more information, see the help message for each subcommand.\n"
|
2022-01-06 01:03:46 +00:00
|
|
|
"For example: resmoke.py run -h\n"
|
2024-05-16 18:00:17 -04:00
|
|
|
"Note: bisect, setup-multiversion and symbolize subcommands have been moved to db-contrib-tool (https://github.com/10gen/db-contrib-tool#readme).\n",
|
2022-01-06 01:03:46 +00:00
|
|
|
)
|
2022-11-28 17:15:48 +00:00
|
|
|
subcommand.execute()
|