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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 try_job.put() | 106 try_job.put() |
| 107 else: | 107 else: |
| 108 need_new_try_job = False | 108 need_new_try_job = False |
| 109 else: | 109 else: |
| 110 try_job = WfTryJob.Create(master_name, builder_name, build_number) | 110 try_job = WfTryJob.Create(master_name, builder_name, build_number) |
| 111 try_job.put() | 111 try_job.put() |
| 112 | 112 |
| 113 return need_new_try_job, last_pass, try_job_type, targeted_tests | 113 return need_new_try_job, last_pass, try_job_type, targeted_tests |
| 114 | 114 |
| 115 | 115 |
| 116 def _GetFailedTargetsFromSignals(signals, master_name, builder_name): | 116 def _GetFailedTargetsFromSignals( |
|
chanli
2016/04/27 22:51:34
Should we change the function name since now we ma
| |
| 117 compile_failures, signals, master_name, builder_name): | |
| 118 # Use failed targets from builder on waterfall if they are available. | |
|
chanli
2016/04/27 22:51:34
'build' or 'builder'?
| |
| 119 if (compile_failures and | |
| 120 not compile_failures.get('unknown_failures') and | |
|
chanli
2016/04/27 22:51:34
I didn't find 'unknown_failures' in https://codere
| |
| 121 not compile_failures.get('unrecognized_format')): | |
| 122 return (compile_failures.get('failed_targets') + | |
| 123 compile_failures.get('unknown_targets')) | |
| 124 | |
| 117 compile_targets = [] | 125 compile_targets = [] |
| 118 | 126 |
| 119 if not signals or 'compile' not in signals: | 127 if not signals or 'compile' not in signals: |
| 120 return compile_targets | 128 return compile_targets |
| 121 | 129 |
| 122 strict_regex = waterfall_config.EnableStrictRegexForCompileLinkFailures( | 130 strict_regex = waterfall_config.EnableStrictRegexForCompileLinkFailures( |
| 123 master_name, builder_name) | 131 master_name, builder_name) |
| 124 for source_target in signals['compile'].get('failed_targets', []): | 132 for source_target in signals['compile'].get('failed_targets', []): |
| 125 # For link failures, we pass the executable targets directly to try-job, and | 133 # For link failures, we pass the executable targets directly to try-job, and |
| 126 # there is no 'source' for link failures. | 134 # there is no 'source' for link failures. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 logging.info('Test try jobs on %s, %s are not supported yet.', | 168 logging.info('Test try jobs on %s, %s are not supported yet.', |
| 161 master_name, builder_name) | 169 master_name, builder_name) |
| 162 return {} | 170 return {} |
| 163 | 171 |
| 164 failure_result_map = {} | 172 failure_result_map = {} |
| 165 need_new_try_job, last_pass, try_job_type, targeted_tests = ( | 173 need_new_try_job, last_pass, try_job_type, targeted_tests = ( |
| 166 _NeedANewTryJob(master_name, builder_name, build_number, | 174 _NeedANewTryJob(master_name, builder_name, build_number, |
| 167 failed_steps, failure_result_map)) | 175 failed_steps, failure_result_map)) |
| 168 | 176 |
| 169 if need_new_try_job: | 177 if need_new_try_job: |
| 170 compile_targets = (_GetFailedTargetsFromSignals( | 178 compile_targets = ( |
| 171 signals, master_name, builder_name) | 179 None if try_job_type != TryJobType.COMPILE else |
| 172 if try_job_type == TryJobType.COMPILE else None) | 180 _GetFailedTargetsFromSignals( |
| 181 failure_info.get('compile_failures'), | |
| 182 signals, master_name, builder_name)) | |
| 173 suspected_revisions = ( | 183 suspected_revisions = ( |
| 174 _GetSuspectsForCompileFailureFromHeuristicResult(heuristic_result) | 184 _GetSuspectsForCompileFailureFromHeuristicResult(heuristic_result) |
| 175 if try_job_type == TryJobType.COMPILE else None) | 185 if try_job_type == TryJobType.COMPILE else None) |
| 176 | 186 |
| 177 pipeline = ( | 187 pipeline = ( |
| 178 swarming_tasks_to_try_job_pipeline.SwarmingTasksToTryJobPipeline( | 188 swarming_tasks_to_try_job_pipeline.SwarmingTasksToTryJobPipeline( |
| 179 master_name, builder_name, build_number, | 189 master_name, builder_name, build_number, |
| 180 builds[str(last_pass)]['chromium_revision'], | 190 builds[str(last_pass)]['chromium_revision'], |
| 181 builds[str(build_number)]['chromium_revision'], | 191 builds[str(build_number)]['chromium_revision'], |
| 182 builds[str(build_number)]['blame_list'], | 192 builds[str(build_number)]['blame_list'], |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 195 pipeline.pipeline_status_path, try_job_type) | 205 pipeline.pipeline_status_path, try_job_type) |
| 196 else: # pragma: no cover | 206 else: # pragma: no cover |
| 197 logging_str = ( | 207 logging_str = ( |
| 198 'Try job was scheduled for build %s, %s, %s: %s because of %s ' | 208 'Try job was scheduled for build %s, %s, %s: %s because of %s ' |
| 199 'failure.') % ( | 209 'failure.') % ( |
| 200 master_name, builder_name, build_number, | 210 master_name, builder_name, build_number, |
| 201 pipeline.pipeline_status_path, try_job_type) | 211 pipeline.pipeline_status_path, try_job_type) |
| 202 logging.info(logging_str) | 212 logging.info(logging_str) |
| 203 | 213 |
| 204 return failure_result_map | 214 return failure_result_map |
| OLD | NEW |