diff options
author | murgatroid99 <mlumish@google.com> | 2017-01-04 15:43:02 -0800 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2017-01-04 15:43:02 -0800 |
commit | c34cac28912595814fb35225957eed0ddfd5d610 (patch) | |
tree | 5b89408b87d756791e6c5dee2247bae3609565cc /tools/run_tests/interop/interop_html_report.template | |
parent | 804c9e90fc4e7d11294fec69801ff7bc99134d3c (diff) | |
parent | 360f5d2abf8cb0f92aeeb3a1b201d2eb3bd13374 (diff) |
Merge branch 'master' into node_electron_build
Diffstat (limited to 'tools/run_tests/interop/interop_html_report.template')
-rw-r--r-- | tools/run_tests/interop/interop_html_report.template | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/tools/run_tests/interop/interop_html_report.template b/tools/run_tests/interop/interop_html_report.template new file mode 100644 index 0000000000..46cce426b7 --- /dev/null +++ b/tools/run_tests/interop/interop_html_report.template @@ -0,0 +1,177 @@ +<!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> + +<%def name="fill_one_http2_test_result(shortname, resultset)"> + ## keep this mostly in sync with the template above + % 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.http2results: + <td bgcolor="white"> + <div style="width:95%; border: 1px solid black; position: relative; padding: 3px;"> + <span style="position: absolute; left: 45%;">${int(result.http2results['percent'] * 100)}%</span> + <div style="height: 20px; + background-color: hsl(${result.http2results['percent'] * 120}, 100%, 50%); + width: ${result.http2results['percent'] * 100}%;" + title="${result.http2results['failed_cases'] | h}"></div> + </div> + </td> + % else: + <td bgcolor="red">No result is found!</td> + % endif + % else: + <td bgcolor="magenta">Not implemented</td> + % endif +</%def> + +<%def name="display_cloud_to_prod_result(prod_server)"> + ## Each column header is the client language. + <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:%s' % ( + prod_server, client_lang, test_case) + else: + shortname = 'cloud_to_prod:%s:%s:%s' % ( + prod_server, client_lang, test_case) + %> + ${fill_one_test_result(shortname, resultset)} + % endfor + </tr> + % endfor + </table> +</%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: + % for prod_server in prod_servers: + <h2>Cloud to ${prod_server}</h2> + ${display_cloud_to_prod_result(prod_server)} + % endfor +% 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: + % for prod_server in prod_servers: + <th>${prod_server}</th> + % endfor + % 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_http2_test_result(shortname, resultset)} + % endfor + % if cloud_to_prod: + % for prod_server in prod_servers: + <% shortname = 'cloud_to_prod:%s:http2:%s' % (prod_server, test_case) %> + ${fill_one_http2_test_result(shortname, resultset)} + % endfor + % 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> |