| 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 contextlib | 5 import contextlib |
| 6 from datetime import datetime | 6 from datetime import datetime |
| 7 import gzip | 7 import gzip |
| 8 import json | 8 import json |
| 9 import re | 9 import re |
| 10 import urllib | 10 import urllib |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 build_info = BuildInfo(master_name, builder_name, build_number) | 191 build_info = BuildInfo(master_name, builder_name, build_number) |
| 192 | 192 |
| 193 data_json = json.loads(build_data) | 193 data_json = json.loads(build_data) |
| 194 chromium_revision = GetBuildProperty( | 194 chromium_revision = GetBuildProperty( |
| 195 data_json.get('properties', []), 'got_revision') | 195 data_json.get('properties', []), 'got_revision') |
| 196 | 196 |
| 197 build_info.build_start_time = GetBuildStartTime(data_json) | 197 build_info.build_start_time = GetBuildStartTime(data_json) |
| 198 build_info.chromium_revision = chromium_revision | 198 build_info.chromium_revision = chromium_revision |
| 199 build_info.completed = data_json.get('currentStep') is None | 199 build_info.completed = data_json.get('currentStep') is None |
| 200 build_info.result = GetBuildResult(data_json) | 200 build_info.result = GetBuildResult(data_json) |
| 201 build_info.compile_failures = GetBuildProperty( |
| 202 data_json.get('properties', []), 'compile_failures') |
| 201 | 203 |
| 202 changes = data_json.get('sourceStamp', {}).get('changes', []) | 204 changes = data_json.get('sourceStamp', {}).get('changes', []) |
| 203 for change in changes: | 205 for change in changes: |
| 204 if change['revision'] not in build_info.blame_list: | 206 if change['revision'] not in build_info.blame_list: |
| 205 build_info.blame_list.append(change['revision']) | 207 build_info.blame_list.append(change['revision']) |
| 206 | 208 |
| 207 # Step categories: | 209 # Step categories: |
| 208 # 1. A step is passed if it is in SUCCESS or WARNINGS status. | 210 # 1. A step is passed if it is in SUCCESS or WARNINGS status. |
| 209 # 2. A step is failed if it is in FAILED status. | 211 # 2. A step is failed if it is in FAILED status. |
| 210 # 3. A step is not passed if it is not in SUCCESS or WARNINGS status. This | 212 # 3. A step is not passed if it is not in SUCCESS or WARNINGS status. This |
| (...skipping 18 matching lines...) Expand all Loading... |
| 229 # the annotating step like "steps" fail too. Such annotating steps have a | 231 # the annotating step like "steps" fail too. Such annotating steps have a |
| 230 # log with name "preamble". | 232 # log with name "preamble". |
| 231 continue | 233 continue |
| 232 | 234 |
| 233 if step_result in (SUCCESS, WARNINGS): | 235 if step_result in (SUCCESS, WARNINGS): |
| 234 build_info.passed_steps.append(step_name) | 236 build_info.passed_steps.append(step_name) |
| 235 elif step_result == FAILURE: | 237 elif step_result == FAILURE: |
| 236 build_info.failed_steps.append(step_name) | 238 build_info.failed_steps.append(step_name) |
| 237 | 239 |
| 238 return build_info | 240 return build_info |
| OLD | NEW |