mirror of https://github.com/grpc/grpc.git
Merge pull request #4062 from adelez/mako_template
Use mako template for HTML report.reviewable/pr4035/r4^2
commit
7b63a6c8ea
4 changed files with 175 additions and 140 deletions
@ -0,0 +1,141 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head><title>Interop Test Result</title></head> |
||||
<body> |
||||
|
||||
<%def name="fill_one_test_result(shortname, resultset)"> |
||||
% if shortname in resultset: |
||||
## Because interop tests does not have runs_per_test flag, each test is |
||||
## run once. So there should only be one element for each result. |
||||
<% result = resultset[shortname][0] %> |
||||
% if result.state == 'PASSED': |
||||
<td bgcolor="green">PASS</td> |
||||
% else: |
||||
<% |
||||
tooltip = '' |
||||
if result.returncode > 0 or result.message: |
||||
if result.returncode > 0: |
||||
tooltip = 'returncode: %d ' % result.returncode |
||||
if result.message: |
||||
tooltip = '%smessage: %s' % (tooltip, result.message) |
||||
%> |
||||
% if result.state == 'FAILED': |
||||
<td bgcolor="red"> |
||||
% if tooltip: |
||||
<a href="#" data-toggle="tooltip" data-placement="auto" title="${tooltip | h}">FAIL</a></td> |
||||
% else: |
||||
FAIL</td> |
||||
% endif |
||||
% elif result.state == 'TIMEOUT': |
||||
<td bgcolor="yellow"> |
||||
% if tooltip: |
||||
<a href="#" data-toggle="tooltip" data-placement="auto" title="${tooltip | h}">TIMEOUT</a></td> |
||||
% else: |
||||
TIMEOUT</td> |
||||
% endif |
||||
% endif |
||||
% endif |
||||
% else: |
||||
<td bgcolor="magenta">Not implemented</td> |
||||
% endif |
||||
</%def> |
||||
|
||||
% if num_failures > 1: |
||||
<p><h2><font color="red">${num_failures} tests failed!</font></h2></p> |
||||
% elif num_failures: |
||||
<p><h2><font color="red">${num_failures} test failed!</font></h2></p> |
||||
% else: |
||||
<p><h2><font color="green">All tests passed!</font></h2></p> |
||||
% endif |
||||
|
||||
% if cloud_to_prod: |
||||
## Each column header is the client language. |
||||
<h2>Cloud to Prod</h2> |
||||
<table style="width:100%" border="1"> |
||||
<tr bgcolor="#00BFFF"> |
||||
<th>Client languages ►<br/>Test Cases ▼</th> |
||||
% for client_lang in client_langs: |
||||
<th>${client_lang}</th> |
||||
% endfor |
||||
</tr> |
||||
% for test_case in test_cases + auth_test_cases: |
||||
<tr><td><b>${test_case}</b></td> |
||||
% for client_lang in client_langs: |
||||
<% |
||||
if test_case in auth_test_cases: |
||||
shortname = 'cloud_to_prod_auth:%s:%s' % (client_lang, test_case) |
||||
else: |
||||
shortname = 'cloud_to_prod:%s:%s' % (client_lang, test_case) |
||||
%> |
||||
${fill_one_test_result(shortname, resultset)} |
||||
% endfor |
||||
</tr> |
||||
% endfor |
||||
</table> |
||||
% endif |
||||
|
||||
% if http2_interop: |
||||
## Each column header is the server language. |
||||
<h2>HTTP/2 Interop</h2> |
||||
<table style="width:100%" border="1"> |
||||
<tr bgcolor="#00BFFF"> |
||||
<th>Servers ►<br/>Test Cases ▼</th> |
||||
% for server_lang in server_langs: |
||||
<th>${server_lang}</th> |
||||
% endfor |
||||
% if cloud_to_prod: |
||||
<th>prod</th> |
||||
% endif |
||||
</tr> |
||||
% for test_case in http2_cases: |
||||
<tr><td><b>${test_case}</b></td> |
||||
## Fill up the cells with test result. |
||||
% for server_lang in server_langs: |
||||
<% |
||||
shortname = 'cloud_to_cloud:http2:%s_server:%s' % ( |
||||
server_lang, test_case) |
||||
%> |
||||
${fill_one_test_result(shortname, resultset)} |
||||
% endfor |
||||
% if cloud_to_prod: |
||||
<% shortname = 'cloud_to_prod:http2:%s' % test_case %> |
||||
${fill_one_test_result(shortname, resultset)} |
||||
% endif |
||||
</tr> |
||||
% endfor |
||||
</table> |
||||
% endif |
||||
|
||||
% if server_langs: |
||||
% for test_case in test_cases: |
||||
## Each column header is the client language. |
||||
<h2>${test_case}</h2> |
||||
<table style="width:100%" border="1"> |
||||
<tr bgcolor="#00BFFF"> |
||||
<th>Client languages ►<br/>Server languages ▼</th> |
||||
% for client_lang in client_langs: |
||||
<th>${client_lang}</th> |
||||
% endfor |
||||
</tr> |
||||
## Each row head is the server language. |
||||
% for server_lang in server_langs: |
||||
<tr> |
||||
<td><b>${server_lang}</b></td> |
||||
% for client_lang in client_langs: |
||||
<% |
||||
shortname = 'cloud_to_cloud:%s:%s_server:%s' % ( |
||||
client_lang, server_lang, test_case) |
||||
%> |
||||
${fill_one_test_result(shortname, resultset)} |
||||
% endfor |
||||
</tr> |
||||
% endfor |
||||
</table> |
||||
% endfor |
||||
% endif |
||||
|
||||
<script> |
||||
$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip();}); |
||||
</script> |
||||
</body> |
||||
</html> |
Loading…
Reference in new issue