| OLD | NEW |
| (Empty) |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import logging | |
| 6 | |
| 7 from common.pipeline_wrapper import BasePipeline | |
| 8 from waterfall.process_swarming_task_result_pipeline import ( | |
| 9 ProcessSwarmingTaskResultPipeline) | |
| 10 from waterfall.run_try_job_for_reliable_failure_pipeline import ( | |
| 11 RunTryJobForReliableFailurePipeline) | |
| 12 from waterfall.trigger_swarming_task_pipeline import TriggerSwarmingTaskPipeline | |
| 13 from waterfall.try_job_type import TryJobType | |
| 14 | |
| 15 | |
| 16 class SwarmingTasksToTryJobPipeline(BasePipeline): | |
| 17 """Root Pipeline to start swarming tasks and possible try job on the build.""" | |
| 18 | |
| 19 # Arguments number differs from overridden method - pylint: disable=W0221 | |
| 20 def run( | |
| 21 self, master_name, builder_name, build_number, good_revision, | |
| 22 bad_revision, blame_list, try_job_type, compile_targets=None, | |
| 23 targeted_tests=None, suspected_cls=None, force_try_job=False): | |
| 24 | |
| 25 # A list contains tuples of step_names and classified_tests from | |
| 26 # ProcessSwarmingTaskResultPipeline. | |
| 27 # The format would be [('step1', {'flaky_tests': ['test1', ..], ..}), ..] | |
| 28 classified_tests_by_step = [] | |
| 29 | |
| 30 if try_job_type == TryJobType.TEST: | |
| 31 for step_name, base_tests in targeted_tests.iteritems(): | |
| 32 if not base_tests: # Skip non-swarming tests. | |
| 33 continue | |
| 34 # Waits and gets the swarming tasks' results. | |
| 35 step_future = yield ProcessSwarmingTaskResultPipeline( | |
| 36 master_name, builder_name, build_number, step_name) | |
| 37 classified_tests_by_step.append(step_future) | |
| 38 | |
| 39 # Waits until classified_tests_by_step are ready. | |
| 40 yield RunTryJobForReliableFailurePipeline( | |
| 41 master_name, builder_name, build_number, good_revision, | |
| 42 bad_revision, blame_list, try_job_type, compile_targets, | |
| 43 targeted_tests, suspected_cls, force_try_job, | |
| 44 *classified_tests_by_step) | |
| OLD | NEW |