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

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

Issue 1833833002: [Findit] Modify build_failure to prepare for new UI. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@0314-result-page
Patch Set: . Created 4 years, 9 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
Index: appengine/findit/handlers/result_status.py
diff --git a/appengine/findit/handlers/result_status.py b/appengine/findit/handlers/result_status.py
index ff510c23969a8c0f021da5298e7c2df7b00ec1f1..dc2f951b44632073048c2bf815c35498fd17c9e4 100644
--- a/appengine/findit/handlers/result_status.py
+++ b/appengine/findit/handlers/result_status.py
@@ -2,18 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import jinja2
-import os
-
from model import wf_analysis_status
-
-JINJA_ENVIRONMENT = jinja2.Environment(
- loader=jinja2.FileSystemLoader(
- os.path.join(os.path.dirname(__file__), 'templates')),
- extensions=['jinja2.ext.autoescape'],
- autoescape=True)
-
# Additional status for swarming tasks and try jobs.
NO_SWARMING_TASK_FOUND = 110
NON_SWARMING_NO_RERUN = 120
@@ -31,12 +21,12 @@ NO_TRY_JOB_REASON_MAP = {
wf_analysis_status.ERROR: SWARMING_TASK_ERROR,
}
-def ToStatusMessage(status_code):
+def ToStatusMessage():
status_message_map = {
- wf_analysis_status.PENDING: 'try job is pending.',
- wf_analysis_status.ANALYZING: 'try job is running.',
- wf_analysis_status.ANALYZED: 'try job is completed.',
- wf_analysis_status.ERROR: 'try job failed.',
+ wf_analysis_status.PENDING: 'Try job is pending.',
+ wf_analysis_status.ANALYZING: 'Try job is running.',
+ wf_analysis_status.ANALYZED: 'Not Found.',
+ wf_analysis_status.ERROR: 'Try job failed.',
NO_SWARMING_TASK_FOUND: 'No swarming task found, hence no try job.',
NON_SWARMING_NO_RERUN: ('No swarming task nor try job will be triggered'
' for non-swarming steps.'),
@@ -46,6 +36,4 @@ def ToStatusMessage(status_code):
'Swarming task failed, try job will not be triggered.'),
FLAKY: 'Flaky tests.',
}
- return status_message_map.get(status_code, '!!!MESSAGE BUG!!!')
-
-JINJA_ENVIRONMENT.filters['tostatusmessage'] = ToStatusMessage
+ return status_message_map

Powered by Google App Engine
This is Rietveld 408576698