Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 base64 | 5 import base64 |
| 6 import json | 6 import json |
| 7 | 7 |
| 8 from common import constants | 8 from common import constants |
| 9 from common.http_client_appengine import HttpClientAppengine as HttpClient | 9 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 10 from common.pipeline_wrapper import BasePipeline | 10 from common.pipeline_wrapper import BasePipeline |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 self, json_data, step, failed_step=None): | 174 self, json_data, step, failed_step=None): |
| 175 """Parses the json data and saves all the reliable failures to the step.""" | 175 """Parses the json data and saves all the reliable failures to the step.""" |
| 176 failed_test_log = {} | 176 failed_test_log = {} |
| 177 if failed_step: | 177 if failed_step: |
| 178 failed_step['tests'] = {} | 178 failed_step['tests'] = {} |
| 179 | 179 |
| 180 for iteration in json_data.get('per_iteration_data'): | 180 for iteration in json_data.get('per_iteration_data'): |
| 181 for test_name in iteration.keys(): | 181 for test_name in iteration.keys(): |
| 182 is_reliable_failure = True | 182 is_reliable_failure = True |
| 183 | 183 |
| 184 if any(test['status'] == 'SUCCESS' for test in iteration[test_name]): | 184 if (any(test['status'] in ['SUCCESS', 'SKIPPED', 'UNKNOWN'] |
|
lijeffrey
2016/06/01 19:27:03
Maybe move this list to a constant called TEST_STA
chanli
2016/06/02 22:40:09
Done.
| |
| 185 for test in iteration[test_name])): | |
| 185 # Ignore the test if any of the attempts were 'SUCCESS'. | 186 # Ignore the test if any of the attempts were 'SUCCESS'. |
| 186 is_reliable_failure = False | 187 is_reliable_failure = False |
| 187 | 188 |
| 188 if is_reliable_failure: | 189 if is_reliable_failure: |
| 189 if failed_step: | 190 if failed_step: |
| 190 # Adds the test to failed_step. | 191 # Adds the test to failed_step. |
| 191 failed_step['tests'][test_name] = { | 192 failed_step['tests'][test_name] = { |
| 192 'current_failure': failed_step['current_failure'], | 193 'current_failure': failed_step['current_failure'], |
| 193 'first_failure': failed_step['current_failure'], | 194 'first_failure': failed_step['current_failure'], |
| 194 } | 195 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 | 463 |
| 463 failure_info['builds'] = builds | 464 failure_info['builds'] = builds |
| 464 failure_info['failed_steps'] = failed_steps | 465 failure_info['failed_steps'] = failed_steps |
| 465 | 466 |
| 466 analysis = WfAnalysis.Get(master_name, builder_name, build_number) | 467 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
| 467 analysis.not_passed_steps = build_info.not_passed_steps | 468 analysis.not_passed_steps = build_info.not_passed_steps |
| 468 analysis.build_failure_type = build_failure_type | 469 analysis.build_failure_type = build_failure_type |
| 469 analysis.put() | 470 analysis.put() |
| 470 | 471 |
| 471 return failure_info | 472 return failure_info |
| OLD | NEW |