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

Unified Diff: appengine/findit/waterfall/try_job_util.py

Issue 1924823003: [Findit] Use heuristic analysis result for test try jobs(Findit side). (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Use culprits directly if returned from recipe. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/waterfall/test/try_job_util_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/waterfall/try_job_util.py
diff --git a/appengine/findit/waterfall/try_job_util.py b/appengine/findit/waterfall/try_job_util.py
index f0bdeb796804c9db2b7a71ff4c2d959a3167ca1b..e8e613cd520d52070a0356fb68a30e0cc5007e1f 100644
--- a/appengine/findit/waterfall/try_job_util.py
+++ b/appengine/findit/waterfall/try_job_util.py
@@ -135,14 +135,14 @@ def _GetFailedTargetsFromSignals(signals, master_name, builder_name):
return compile_targets
-def _GetSuspectsForCompileFailureFromHeuristicResult(heuristic_result):
- suspected_revisions = []
+def _GetSuspectsFromHeuristicResult(heuristic_result):
+ suspected_revisions = set()
if not heuristic_result:
- return suspected_revisions
+ return list(suspected_revisions)
for failure in heuristic_result.get('failures', []):
- if failure['step_name'] == constants.COMPILE_STEP_NAME:
- suspected_revisions = [c['revision'] for c in failure['suspected_cls']]
- return suspected_revisions
+ for cl in failure['suspected_cls']:
+ suspected_revisions.add(cl['revision'])
+ return list(suspected_revisions)
def ScheduleTryJobIfNeeded(failure_info, signals, heuristic_result):
@@ -173,9 +173,7 @@ def ScheduleTryJobIfNeeded(failure_info, signals, heuristic_result):
compile_targets = (_GetFailedTargetsFromSignals(
signals, master_name, builder_name)
if try_job_type == TryJobType.COMPILE else None)
- suspected_revisions = (
- _GetSuspectsForCompileFailureFromHeuristicResult(heuristic_result)
- if try_job_type == TryJobType.COMPILE else None)
+ suspected_revisions = _GetSuspectsFromHeuristicResult(heuristic_result)
pipeline = (
swarming_tasks_to_try_job_pipeline.SwarmingTasksToTryJobPipeline(
« no previous file with comments | « appengine/findit/waterfall/test/try_job_util_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698