| Index: appengine/findit/waterfall/monitor_try_job_pipeline.py
|
| diff --git a/appengine/findit/waterfall/monitor_try_job_pipeline.py b/appengine/findit/waterfall/monitor_try_job_pipeline.py
|
| index af4e4558df1f8bbe20565cda6f938a62889e5e91..991e8bdacb977628b5f77ebf73550a58e7e0d110 100644
|
| --- a/appengine/findit/waterfall/monitor_try_job_pipeline.py
|
| +++ b/appengine/findit/waterfall/monitor_try_job_pipeline.py
|
| @@ -20,7 +20,8 @@ class MonitorTryJobPipeline(BasePipeline):
|
|
|
| # Arguments number differs from overridden method - pylint: disable=W0221
|
| # TODO(chanli): Handle try job for test failures later.
|
| - def run(self, master_name, builder_name, build_number, try_job_id):
|
| + def run(
|
| + self, master_name, builder_name, build_number, try_job_type, try_job_id):
|
| assert try_job_id
|
|
|
| timeout_hours = 5 # Timeout after 5 hours.
|
| @@ -40,14 +41,23 @@ class MonitorTryJobPipeline(BasePipeline):
|
| }
|
|
|
| try_job_result = WfTryJob.Get(master_name, builder_name, build_number)
|
| - if (try_job_result.compile_results and
|
| - try_job_result.compile_results[-1]['try_job_id'] == try_job_id):
|
| - try_job_result.compile_results[-1].update(result)
|
| - else: # pragma: no cover
|
| - try_job_result.compile_results.append(result)
|
| + if try_job_type == 'compile':
|
| + if (try_job_result.compile_results and
|
| + try_job_result.compile_results[-1]['try_job_id'] == try_job_id):
|
| + try_job_result.compile_results[-1].update(result)
|
| + else: # pragma: no cover
|
| + try_job_result.compile_results.append(result)
|
| + try_job_result.put()
|
| + return try_job_result.compile_results[-1]
|
| + else: # Test failures.
|
| + if (try_job_result.test_results and
|
| + try_job_result.test_results[-1]['try_job_id'] == try_job_id):
|
| + try_job_result.test_results[-1].update(result)
|
| + else: # pragma: no cover
|
| + try_job_result.test_results.append(result)
|
| + try_job_result.put()
|
| + return try_job_result.test_results[-1]
|
|
|
| - try_job_result.put()
|
| - return try_job_result.compile_results[-1]
|
| else: # pragma: no cover
|
| if build.status == 'STARTED' and not already_set_started:
|
| result = {
|
| @@ -57,13 +67,22 @@ class MonitorTryJobPipeline(BasePipeline):
|
| }
|
|
|
| try_job_result = WfTryJob.Get(master_name, builder_name, build_number)
|
| - if (try_job_result.compile_results and
|
| - try_job_result.compile_results[-1]['try_job_id'] == try_job_id):
|
| - try_job_result.compile_results[-1].update(result)
|
| - else: # pragma: no cover
|
| - # Normally result for current try job should've been saved in
|
| - # schedule_try_job_pipeline, so this branch shouldn't be reached.
|
| - try_job_result.compile_results.append(result)
|
| + if try_job_type == 'compile':
|
| + if (try_job_result.compile_results and
|
| + try_job_result.compile_results[-1]['try_job_id'] == try_job_id):
|
| + try_job_result.compile_results[-1].update(result)
|
| + else: # pragma: no cover
|
| + # Normally result for current try job should've been saved in
|
| + # schedule_try_job_pipeline, so this branch shouldn't be reached.
|
| + try_job_result.compile_results.append(result)
|
| + else:
|
| + if (try_job_result.test_results and
|
| + try_job_result.test_results[-1]['try_job_id'] == try_job_id):
|
| + try_job_result.test_results[-1].update(result)
|
| + else: # pragma: no cover
|
| + # Normally result for current try job should've been saved in
|
| + # schedule_try_job_pipeline, so this branch shouldn't be reached.
|
| + try_job_result.test_results.append(result)
|
|
|
| try_job_result.status = wf_analysis_status.ANALYZING
|
| try_job_result.put()
|
|
|