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

Unified Diff: build/android/pylib/results/presentation/test_results_presentation.py

Issue 2873723002: Add link to flakiness dashboard for each test case (Closed)
Patch Set: fixes Created 3 years, 7 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: build/android/pylib/results/presentation/test_results_presentation.py
diff --git a/build/android/pylib/results/presentation/test_results_presentation.py b/build/android/pylib/results/presentation/test_results_presentation.py
index e82b16e544cad44767dcbfd80b2daa20032c38c8..7c67f966c9366c0dae3c1535812a8bf25107a179 100755
--- a/build/android/pylib/results/presentation/test_results_presentation.py
+++ b/build/android/pylib/results/presentation/test_results_presentation.py
@@ -97,7 +97,15 @@ def action_cell(action, data, html_class):
}
-def logs_cell(result):
+def flakiness_dashbord_link(test_name, suite_name):
+ url_args = urllib.urlencode([
+ ('testType', suite_name),
+ ('tests', test_name)])
+ return ('https://test-results.appspot.com/'
+ 'dashboards/flakiness_dashboard.html#%s' % url_args)
+
+
+def logs_cell(result, test_name, suite_name):
"""Formats result logs data for processing in jinja template."""
link_list = []
for name, href in result.get('links', {}).iteritems():
@@ -105,7 +113,10 @@ def logs_cell(result):
data=name,
href=href,
target=LinkTarget.NEW_TAB))
-
+ link_list.append(link(
+ data='flakiness',
+ href=flakiness_dashbord_link(test_name, suite_name),
+ target=LinkTarget.NEW_TAB))
if link_list:
return links_cell(link_list)
else:
@@ -128,7 +139,7 @@ def status_class(status):
return status
-def create_test_table(results_dict, cs_base_url):
+def create_test_table(results_dict, cs_base_url, suite_name):
"""Format test data for injecting into HTML table."""
header_row = [
@@ -151,18 +162,18 @@ def create_test_table(results_dict, cs_base_url):
data=test_name)],
rowspan=len(test_results),
html_class='left %s' % test_name
- )] # test_name
+ )] # test_name
else:
test_run = []
test_run.extend([
cell(data=result['status'] or 'UNKNOWN',
- # status
+ # status
html_class=('center %s' %
status_class(result['status']))),
- cell(data=result['elapsed_time_ms']), # elapsed_time_ms
- logs_cell(result), # logs
- pre_cell(data=result['output_snippet'], # output_snippet
+ cell(data=result['elapsed_time_ms']), # elapsed_time_ms
+ logs_cell(result, test_name, suite_name), # logs
+ pre_cell(data=result['output_snippet'], # output_snippet
html_class='left'),
])
test_runs.append(test_run)
@@ -266,7 +277,8 @@ def results_to_html(results_dict, cs_base_url, bucket, test_name,
builder_name, build_number):
"""Convert list of test results into html format."""
- test_rows_header, test_rows = create_test_table(results_dict, cs_base_url)
+ test_rows_header, test_rows = create_test_table(results_dict, cs_base_url,
+ test_name)
suite_rows_header, suite_rows, suite_row_footer = create_suite_table(
results_dict)
« 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