Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: appengine/findit/handlers/build_failure.py

Issue 1921893004: [Findit] Fix Key error in build_failure handler. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Add a special status to this case and add test. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | appengine/findit/handlers/result_status.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 from collections import defaultdict 5 from collections import defaultdict
6 import copy 6 import copy
7 from datetime import datetime 7 from datetime import datetime
8 import logging 8 import logging
9 import os 9 import os
10 10
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 'try_job': try_job_result, 246 'try_job': try_job_result,
247 'heuristic_analysis': { 247 'heuristic_analysis': {
248 'suspected_cls': heuristic_result['suspected_cls'] 248 'suspected_cls': heuristic_result['suspected_cls']
249 }, 249 },
250 'tests': tests if tests != [NON_SWARMING] else [], 250 'tests': tests if tests != [NON_SWARMING] else [],
251 'first_failure': heuristic_result['first_failure'], 251 'first_failure': heuristic_result['first_failure'],
252 'last_pass': heuristic_result['last_pass'], 252 'last_pass': heuristic_result['last_pass'],
253 'supported': heuristic_result['supported'] 253 'supported': heuristic_result['supported']
254 } 254 }
255 255
256 if try_job_result['status'] == result_status.FLAKY: 256 if ('status' not in try_job_result or
257 try_job_result['status'] in NO_TRY_JOB_REASON_MAP.values()):
258 # There is no try job info but only heuristic result.
259 try_job_result['status'] = try_job_result.get(
260 'status', result_status.UNKNOWN)
261 step_updated_results['unclassified_failures'].append(final_result)
262 elif try_job_result['status'] == result_status.FLAKY:
257 step_updated_results['flaky_failures'].append(final_result) 263 step_updated_results['flaky_failures'].append(final_result)
258 elif try_job_result['status'] in NO_TRY_JOB_REASON_MAP.values():
259 # There is no try job info but only heuristic result.
260 step_updated_results['unclassified_failures'].append(final_result)
261 else: 264 else:
262 step_updated_results['reliable_failures'].append(final_result) 265 step_updated_results['reliable_failures'].append(final_result)
263 266
264 return updated_results 267 return updated_results
265 268
266 269
267 class BuildFailure(BaseHandler): 270 class BuildFailure(BaseHandler):
268 PERMISSION_LEVEL = Permission.ANYONE 271 PERMISSION_LEVEL = Permission.ANYONE
269 272
270 def _ShowDebugInfo(self): 273 def _ShowDebugInfo(self):
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 'data': self._PrepareDataForCompileFailure(analysis), 399 'data': self._PrepareDataForCompileFailure(analysis),
397 } 400 }
398 else: 401 else:
399 return { 402 return {
400 'template': 'build_failure.html', 403 'template': 'build_failure.html',
401 'data': self._PrepareDataForTestFailures(analysis, build_info), 404 'data': self._PrepareDataForTestFailures(analysis, build_info),
402 } 405 }
403 406
404 def HandlePost(self): # pragma: no cover 407 def HandlePost(self): # pragma: no cover
405 return self.HandleGet() 408 return self.HandleGet()
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/handlers/result_status.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698