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

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

Issue 1591003002: [Findit] Modify tryjob pipelines to trigger try jobs for test failure. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: . Created 4 years, 11 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
Index: appengine/findit/waterfall/schedule_try_job_pipeline.py
diff --git a/appengine/findit/waterfall/schedule_try_job_pipeline.py b/appengine/findit/waterfall/schedule_try_job_pipeline.py
index a28b21a6c880f849e4671001d28284c0cc64d23d..b87e853090dbc7d32ce19a079714de31494cf054 100644
--- a/appengine/findit/waterfall/schedule_try_job_pipeline.py
+++ b/appengine/findit/waterfall/schedule_try_job_pipeline.py
@@ -7,39 +7,44 @@ from model.wf_try_job import WfTryJob
from pipeline_wrapper import BasePipeline
from pipeline_wrapper import pipeline
from waterfall import waterfall_config
+from waterfall.try_job_type import TryJobType
class ScheduleTryJobPipeline(BasePipeline):
"""A pipeline for scheduling a new try job for current build."""
- def _getBuildProperties(self, recipe, master_name, builder_name,
- good_revision, bad_revision, compile_targets):
-
+ def _GetBuildProperties(
+ self, master_name, builder_name, good_revision, bad_revision,
+ try_job_type, compile_targets, targeted_tests):
properties = {
- 'recipe': recipe,
+ 'recipe': 'findit/chromium/%s' % try_job_type,
'good_revision': good_revision,
'bad_revision': bad_revision,
- 'target_mastername': master_name,
- 'target_buildername': builder_name
+ 'target_mastername': master_name
}
- if compile_targets:
- properties['compile_targets'] = compile_targets
+ if try_job_type == TryJobType.COMPILE:
+ properties['target_buildername'] = builder_name
+ if compile_targets:
+ properties['compile_targets'] = compile_targets
+ else: # try_job_type is 'test'.
+ properties['target_testername'] = builder_name
+ assert targeted_tests
+ properties['tests'] = targeted_tests
return properties
# Arguments number differs from overridden method - pylint: disable=W0221
def run(
- self, master_name, builder_name, build_number,
- good_revision, bad_revision, compile_targets):
+ self, master_name, builder_name, build_number, good_revision,
+ bad_revision, try_job_type, compile_targets, targeted_tests):
tryserver_mastername, tryserver_buildername = (
waterfall_config.GetTrybotForWaterfallBuilder(
master_name, builder_name))
- recipe = 'findit/chromium/compile'
- properties = self._getBuildProperties(
- recipe, master_name, builder_name, good_revision, bad_revision,
- compile_targets)
+ properties = self._GetBuildProperties(
+ master_name, builder_name, good_revision, bad_revision,
+ try_job_type, compile_targets, targeted_tests)
try_job = buildbucket_client.TryJob(
tryserver_mastername, tryserver_buildername, None, properties, [])
@@ -50,7 +55,10 @@ class ScheduleTryJobPipeline(BasePipeline):
'Error "%s" occurred. Reason: "%s"' % (error.message, error.reason))
try_job_result = WfTryJob.Get(master_name, builder_name, build_number)
- try_job_result.compile_results.append({'try_job_id': build.id})
+ if try_job_type == TryJobType.COMPILE:
+ try_job_result.compile_results.append({'try_job_id': build.id})
+ else:
+ try_job_result.test_results.append({'try_job_id': build.id})
try_job_result.put()
return build.id

Powered by Google App Engine
This is Rietveld 408576698