| 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 datetime import datetime | 5 from datetime import datetime |
| 6 import logging | 6 import logging |
| 7 | 7 |
| 8 from google.appengine.ext import ndb | 8 from google.appengine.ext import ndb |
| 9 | 9 |
| 10 from common import appengine_util | 10 from common import appengine_util |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if failure_need_try_job: | 63 if failure_need_try_job: |
| 64 targeted_tests[failure_name] = failure_targeted_tests | 64 targeted_tests[failure_name] = failure_targeted_tests |
| 65 else: | 65 else: |
| 66 failure_need_try_job, failure_last_pass = _CheckFailureForTryJobKey( | 66 failure_need_try_job, failure_last_pass = _CheckFailureForTryJobKey( |
| 67 master_name, builder_name, build_number, | 67 master_name, builder_name, build_number, |
| 68 failure_result_map, failure_name, failure) | 68 failure_result_map, failure_name, failure) |
| 69 if failure_need_try_job: | 69 if failure_need_try_job: |
| 70 if failure_level == 'step': | 70 if failure_level == 'step': |
| 71 targeted_tests[failure_name] = [] | 71 targeted_tests[failure_name] = [] |
| 72 else: | 72 else: |
| 73 targeted_tests.append(failure_name) | 73 targeted_tests.append(failure.get('base_test_name', failure_name)) |
| 74 | 74 |
| 75 need_new_try_job = need_new_try_job or failure_need_try_job | 75 need_new_try_job = need_new_try_job or failure_need_try_job |
| 76 last_pass = (failure_last_pass if failure_last_pass and | 76 last_pass = (failure_last_pass if failure_last_pass and |
| 77 failure_last_pass < last_pass else last_pass) | 77 failure_last_pass < last_pass else last_pass) |
| 78 | 78 |
| 79 return targeted_tests, need_new_try_job, last_pass | 79 return targeted_tests, need_new_try_job, last_pass |
| 80 | 80 |
| 81 | 81 |
| 82 @ndb.transactional | 82 @ndb.transactional |
| 83 def _NeedANewTryJob( | 83 def _NeedANewTryJob( |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 pipeline.pipeline_status_path, try_job_type) | 214 pipeline.pipeline_status_path, try_job_type) |
| 215 else: # pragma: no cover | 215 else: # pragma: no cover |
| 216 logging_str = ( | 216 logging_str = ( |
| 217 'Try job was scheduled for build %s, %s, %s: %s because of %s ' | 217 'Try job was scheduled for build %s, %s, %s: %s because of %s ' |
| 218 'failure.') % ( | 218 'failure.') % ( |
| 219 master_name, builder_name, build_number, | 219 master_name, builder_name, build_number, |
| 220 pipeline.pipeline_status_path, try_job_type) | 220 pipeline.pipeline_status_path, try_job_type) |
| 221 logging.info(logging_str) | 221 logging.info(logging_str) |
| 222 | 222 |
| 223 return failure_result_map | 223 return failure_result_map |
| OLD | NEW |