| 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 from common.git_repository import GitRepository | 5 from common.git_repository import GitRepository |
| 6 from common.http_client_appengine import HttpClientAppengine as HttpClient | 6 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 7 from common.pipeline_wrapper import BasePipeline | 7 from common.pipeline_wrapper import BasePipeline |
| 8 from model import analysis_status | 8 from model import analysis_status |
| 9 from model.wf_try_job import WfTryJob | 9 from model.wf_try_job import WfTryJob |
| 10 from model.wf_try_job_data import WfTryJobData | 10 from model.wf_try_job_data import WfTryJobData |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 The failed revision from compile_results, or None if not found. | 70 The failed revision from compile_results, or None if not found. |
| 71 """ | 71 """ |
| 72 if not compile_result: | 72 if not compile_result: |
| 73 return None | 73 return None |
| 74 | 74 |
| 75 report = compile_result.get('report') | 75 report = compile_result.get('report') |
| 76 | 76 |
| 77 if not report: | 77 if not report: |
| 78 return None | 78 return None |
| 79 | 79 |
| 80 if report.get('culprit'): |
| 81 return report.get('culprit') |
| 82 |
| 80 return IdentifyTryJobCulpritPipeline._GetFailedRevisionFromResultsDict( | 83 return IdentifyTryJobCulpritPipeline._GetFailedRevisionFromResultsDict( |
| 81 report.get('result', {})) | 84 report.get('result', {})) |
| 82 | 85 |
| 83 def _FindCulpritForEachTestFailure(self, blame_list, result): | 86 def _FindCulpritForEachTestFailure(self, blame_list, result): |
| 84 # For test failures, the try job will run against every revision, | 87 # For test failures, the try job will run against every revision, |
| 85 # so we need to traverse the result dict in chronological order to identify | 88 # so we need to traverse the result dict in chronological order to identify |
| 86 # the culprits for each failed step or test. | 89 # the culprits for each failed step or test. |
| 87 culprit_map = {} | 90 culprit_map = {} |
| 88 failed_revisions = [] | 91 failed_revisions = [] |
| 89 for revision in blame_list: | 92 for revision in blame_list: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (result_to_update and | 185 if (result_to_update and |
| 183 result_to_update[-1]['try_job_id'] == try_job_id): | 186 result_to_update[-1]['try_job_id'] == try_job_id): |
| 184 result_to_update[-1].update(result) | 187 result_to_update[-1].update(result) |
| 185 else: # pragma: no cover | 188 else: # pragma: no cover |
| 186 result_to_update.append(result) | 189 result_to_update.append(result) |
| 187 | 190 |
| 188 try_job_result.status = analysis_status.COMPLETED | 191 try_job_result.status = analysis_status.COMPLETED |
| 189 try_job_result.put() | 192 try_job_result.put() |
| 190 | 193 |
| 191 return result.get('culprit') if result else None | 194 return result.get('culprit') if result else None |
| OLD | NEW |