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

Unified Diff: appengine/findit/handlers/handlers_util.py

Issue 1945993002: [Findit] Fix Key_error: 'review_url' in handlers_util.py (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: fix nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/handlers_util.py
diff --git a/appengine/findit/handlers/handlers_util.py b/appengine/findit/handlers/handlers_util.py
index e8194774cca0127a77033ce10e217c5a9187c28c..ae6b95791dae2d523f3bf7991b022548de818fbd 100644
--- a/appengine/findit/handlers/handlers_util.py
+++ b/appengine/findit/handlers/handlers_util.py
@@ -230,24 +230,24 @@ def _GetCulpritInfoForTryJobResultForTest(try_job_key, culprits_info):
# Uses culprits to group tests.
culprit_tests_map = _OrganizeTryJobResultByCulprits(
try_job_result['culprit'][ref_name])
- unrgouped_tests = try_job_info['tests']
+ ungrouped_tests = try_job_info['tests']
list_of_culprits = []
for culprit_info in culprit_tests_map.values():
failed_tests = culprit_info['failed_tests']
list_of_culprits.append(culprit_info)
# Gets tests that haven't been grouped.
- unrgouped_tests = list(
- set(unrgouped_tests) ^ set(failed_tests))
- if not unrgouped_tests:
+ ungrouped_tests = list(
+ set(ungrouped_tests) ^ set(failed_tests))
+ if not ungrouped_tests:
# All tests have been grouped.
break
index_start = 1
- if unrgouped_tests:
+ if ungrouped_tests:
# There are tests don't have try job culprits.
# Group these tests together.
# Save them in current try_job_info.
- try_job_info['tests'] = unrgouped_tests
+ try_job_info['tests'] = ungrouped_tests
try_job_info['culprit'] = {}
# Saves all the tests that have culprits later.
index_start = 0
@@ -257,7 +257,8 @@ def _GetCulpritInfoForTryJobResultForTest(try_job_key, culprits_info):
try_job_info['culprit'] = {
'revision': list_of_culprits[0]['revision'],
'commit_position': list_of_culprits[0]['commit_position'],
- 'review_url': list_of_culprits[0]['review_url']
+ 'review_url': list_of_culprits[0].get(
+ 'url', list_of_culprits[0].get('review_url', None))
}
try_job_info['tests'] = list_of_culprits[0]['failed_tests']
@@ -268,7 +269,8 @@ def _GetCulpritInfoForTryJobResultForTest(try_job_key, culprits_info):
tmp_try_job_info['culprit'] = {
'revision': iterate_culprit['revision'],
'commit_position': iterate_culprit['commit_position'],
- 'review_url': iterate_culprit['review_url']
+ 'review_url': iterate_culprit.get(
+ 'url', iterate_culprit.get('review_url', None))
}
tmp_try_job_info['tests'] = iterate_culprit['failed_tests']
additional_tests_culprit_info.append(tmp_try_job_info)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698