Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 | 6 |
| 7 from google.appengine.ext import ndb | 7 from google.appengine.ext import ndb |
| 8 | 8 |
| 9 from common import appengine_util | 9 from common import appengine_util |
| 10 from common import constants | 10 from common import constants |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 master_name, builder_name, build_number, | 90 master_name, builder_name, build_number, |
| 91 failure_result_map, TryJobType.COMPILE, failed_steps['compile']) | 91 failure_result_map, TryJobType.COMPILE, failed_steps['compile']) |
| 92 else: | 92 else: |
| 93 try_job_type = TryJobType.TEST | 93 try_job_type = TryJobType.TEST |
| 94 targeted_tests, need_new_try_job, last_pass = ( | 94 targeted_tests, need_new_try_job, last_pass = ( |
| 95 _CheckIfNeedNewTryJobForTestFailure( | 95 _CheckIfNeedNewTryJobForTestFailure( |
| 96 'step', master_name, builder_name, build_number, failure_result_map, | 96 'step', master_name, builder_name, build_number, failure_result_map, |
| 97 failed_steps)) | 97 failed_steps)) |
| 98 | 98 |
| 99 if need_new_try_job: | 99 if need_new_try_job: |
| 100 try_job = WfTryJob.Get( | 100 try_job = WfTryJob.Get(master_name, builder_name, build_number) |
| 101 master_name, builder_name, build_number) | |
| 102 | 101 |
| 103 if try_job: | 102 if try_job: |
| 104 if try_job.failed: | 103 if try_job.failed: |
| 105 try_job.status = analysis_status.PENDING | 104 try_job.status = analysis_status.PENDING |
| 106 try_job.put() | 105 try_job.put() |
| 107 else: | 106 else: |
| 108 need_new_try_job = False | 107 need_new_try_job = False |
| 109 else: | |
| 110 try_job = WfTryJob.Create( | |
| 111 master_name, builder_name, build_number) | |
| 112 try_job.put() | |
| 113 | 108 |
| 114 return need_new_try_job, last_pass, try_job_type, targeted_tests | 109 return need_new_try_job, last_pass, try_job_type, targeted_tests |
| 115 | 110 |
| 116 | 111 |
| 117 def _GetFailedTargetsFromSignals(signals, master_name, builder_name): | 112 def _GetFailedTargetsFromSignals(signals, master_name, builder_name): |
| 118 compile_targets = [] | 113 compile_targets = [] |
| 119 | 114 |
| 120 if not signals or 'compile' not in signals: | 115 if not signals or 'compile' not in signals: |
| 121 return compile_targets | 116 return compile_targets |
| 122 | 117 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 _NeedANewTryJob(master_name, builder_name, build_number, | 157 _NeedANewTryJob(master_name, builder_name, build_number, |
| 163 failed_steps, failure_result_map)) | 158 failed_steps, failure_result_map)) |
| 164 | 159 |
| 165 if (try_job_type == TryJobType.TEST and | 160 if (try_job_type == TryJobType.TEST and |
| 166 waterfall_config.ShouldSkipTestTryJobs(master_name, builder_name)): | 161 waterfall_config.ShouldSkipTestTryJobs(master_name, builder_name)): |
| 167 logging.info('Test try jobs on %s, %s are not supported yet.', | 162 logging.info('Test try jobs on %s, %s are not supported yet.', |
| 168 master_name, builder_name) | 163 master_name, builder_name) |
| 169 return {} | 164 return {} |
| 170 | 165 |
| 171 if need_new_try_job: | 166 if need_new_try_job: |
| 167 try_job = WfTryJob.Create(master_name, builder_name, build_number) | |
|
stgao
2016/04/18 22:05:27
No, we'd better not do it like this.
If there are
| |
| 168 try_job.put() | |
| 169 | |
| 172 compile_targets = (_GetFailedTargetsFromSignals( | 170 compile_targets = (_GetFailedTargetsFromSignals( |
| 173 signals, master_name, builder_name) | 171 signals, master_name, builder_name) |
| 174 if try_job_type == TryJobType.COMPILE else None) | 172 if try_job_type == TryJobType.COMPILE else None) |
| 175 suspected_revisions = ( | 173 suspected_revisions = ( |
| 176 _GetSuspectsForCompileFailureFromHeuristicResult(heuristic_result) | 174 _GetSuspectsForCompileFailureFromHeuristicResult(heuristic_result) |
| 177 if try_job_type == TryJobType.COMPILE else None) | 175 if try_job_type == TryJobType.COMPILE else None) |
| 178 | 176 |
| 179 pipeline = ( | 177 pipeline = ( |
| 180 swarming_tasks_to_try_job_pipeline.SwarmingTasksToTryJobPipeline( | 178 swarming_tasks_to_try_job_pipeline.SwarmingTasksToTryJobPipeline( |
| 181 master_name, builder_name, build_number, | 179 master_name, builder_name, build_number, |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 197 pipeline.pipeline_status_path, try_job_type) | 195 pipeline.pipeline_status_path, try_job_type) |
| 198 else: # pragma: no cover | 196 else: # pragma: no cover |
| 199 logging_str = ( | 197 logging_str = ( |
| 200 'Try job was scheduled for build %s, %s, %s: %s because of %s ' | 198 'Try job was scheduled for build %s, %s, %s: %s because of %s ' |
| 201 'failure.') % ( | 199 'failure.') % ( |
| 202 master_name, builder_name, build_number, | 200 master_name, builder_name, build_number, |
| 203 pipeline.pipeline_status_path, try_job_type) | 201 pipeline.pipeline_status_path, try_job_type) |
| 204 logging.info(logging_str) | 202 logging.info(logging_str) |
| 205 | 203 |
| 206 return failure_result_map | 204 return failure_result_map |
| OLD | NEW |