From df4243e71b7c69c4da59c90e657f0749d6c9c979 Mon Sep 17 00:00:00 2001 From: Jonathan Abrahams Date: Mon, 25 Feb 2019 13:13:42 -0500 Subject: SERVER-39311 Enable burn_in repetition count: at least 2 executions, with a maximum of 1000 excutions or 10 minutes of execution time --- buildscripts/burn_in_tests.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'buildscripts/burn_in_tests.py') diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py index 398184d4f96..906aa618e7a 100644 --- a/buildscripts/burn_in_tests.py +++ b/buildscripts/burn_in_tests.py @@ -65,9 +65,13 @@ def parse_command_line(): help="The base commit to compare to for determining changes.") parser.add_option("--buildVariant", dest="buildvariant", default=None, - help=("The buildvariant the tasks will execute on. Required when" + help=("The buildvariant to select the tasks. Required when" " generating the JSON file with test executor information")) + parser.add_option("--runBuildVariant", dest="run_buildvariant", default=None, + help=("The buildvariant the tasks will execute on. If not specied then tasks" + " will execute on the the buildvariant specied in --buildVariant.")) + parser.add_option("--distro", dest="distro", default=None, help=("The distro the tasks will execute on. Can only be specified" " with --generateTasksFile.")) @@ -119,6 +123,14 @@ def parse_command_line(): return options, args +def check_variant(buildvariant, parser): + """Check if the buildvariant is found in the evergreen file.""" + evg_conf = evergreen.parse_evergreen_file(EVERGREEN_FILE) + if not evg_conf.get_variant(buildvariant): + parser.error("Buildvariant '{}' not found in {}, select from:\n\t{}".format( + buildvariant, EVERGREEN_FILE, "\n\t".join(sorted(evg_conf.variant_names)))) + + def validate_options(parser, options): """Validate command line options.""" @@ -139,10 +151,10 @@ def validate_options(parser, options): parser.error("Must specify --buildVariant to find changed tests") if options.buildvariant: - evg_conf = evergreen.parse_evergreen_file(EVERGREEN_FILE) - if not evg_conf.get_variant(options.buildvariant): - parser.error("Buildvariant '{}' not found in {}, select from:\n\t{}".format( - options.buildvariant, EVERGREEN_FILE, "\n\t".join(sorted(evg_conf.variant_names)))) + check_variant(options.buildvariant, parser) + + if options.run_buildvariant: + check_variant(options.run_buildvariant, parser) def find_last_activated_task(revisions, variant, branch_name): @@ -428,6 +440,13 @@ def _sub_task_name(variant, task, task_num): return "burn_in:{}_{}_{}".format(variant, task, task_num) +def _get_run_buildvariant(options): + """Return the build variant to execute the tasks on.""" + if options.run_buildvariant: + return options.run_buildvariant + return options.buildvariant + + def create_generate_tasks_file(options, tests_by_task): """Create the Evergreen generate.tasks file.""" @@ -462,7 +481,7 @@ def create_generate_tasks_file(options, tests_by_task): evg_sub_task.commands(commands) display_task = DisplayTaskDefinition("burn_in_tests").execution_tasks(task_names) - evg_config.variant(options.buildvariant).tasks(task_specs).display_task(display_task) + evg_config.variant(_get_run_buildvariant(options)).tasks(task_specs).display_task(display_task) _write_json_file(evg_config.to_map(), options.generate_tasks_file) -- cgit v1.2.1