Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: appengine/findit/waterfall/swarming_tasks_to_try_job_pipeline.py

Issue 2187763004: [Findit] Refactor Findit pipeline. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase and address comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698