aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-12-09 15:34:27 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-12-09 15:34:27 -0800
commitb897337994a355d7d8aeca043b608fa1e100bf79 (patch)
tree779439f28e3f20bcd17acc6fa24c679e19fc58c7 /tools/run_tests
parentface446997e271107553a071c46f8ca0fde0bebb (diff)
parent9bfc2ce06cd700fcbaa701914b4b294b7d601948 (diff)
Merge github.com:grpc/grpc into connectivity-state
Diffstat (limited to 'tools/run_tests')
-rw-r--r--tools/run_tests/interop_html_report.template141
-rw-r--r--tools/run_tests/report_utils.py8
-rw-r--r--tools/run_tests/sources_and_headers.json18
-rw-r--r--tools/run_tests/tests.json18
4 files changed, 176 insertions, 9 deletions
diff --git a/tools/run_tests/interop_html_report.template b/tools/run_tests/interop_html_report.template
new file mode 100644
index 0000000000..1ba2e6cfc2
--- /dev/null
+++ b/tools/run_tests/interop_html_report.template
@@ -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 &#9658;<br/>Test Cases &#9660;</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 &#9658;<br/>Test Cases &#9660;</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 &#9658;<br/>Server languages &#9660;</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>
diff --git a/tools/run_tests/report_utils.py b/tools/run_tests/report_utils.py
index adeb707a07..12b1972f1a 100644
--- a/tools/run_tests/report_utils.py
+++ b/tools/run_tests/report_utils.py
@@ -78,8 +78,7 @@ def render_interop_html_report(
client_langs, server_langs, test_cases, auth_test_cases, http2_cases,
resultset, num_failures, cloud_to_prod, http2_interop):
"""Generate HTML report for interop tests."""
- html_report_dir = 'reports'
- template_file = os.path.join(html_report_dir, 'interop_html_report.template')
+ template_file = 'tools/run_tests/interop_html_report.template'
try:
mytemplate = Template(filename=template_file, format_exceptions=True)
except NameError:
@@ -104,6 +103,9 @@ def render_interop_html_report(
'num_failures': num_failures,
'cloud_to_prod': cloud_to_prod,
'http2_interop': http2_interop}
- html_file_path = os.path.join(html_report_dir, 'index.html')
+ html_report_out_dir = 'reports'
+ if not os.path.exists(html_report_out_dir):
+ os.mkdir(html_report_out_dir)
+ html_file_path = os.path.join(html_report_out_dir, 'index.html')
with open(html_file_path, 'w') as output_file:
mytemplate.render_context(Context(output_file, **args))
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index 5be63bbe2b..af94a1a38d 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -4,6 +4,18 @@
{
"deps": [
"gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "alloc_test",
+ "src": [
+ "test/core/support/alloc_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
@@ -14475,7 +14487,6 @@
"src/core/channel/context.h",
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h",
- "src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h",
"src/core/client_config/connector.h",
@@ -14630,8 +14641,6 @@
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.c",
"src/core/channel/http_server_filter.h",
- "src/core/channel/noop_filter.c",
- "src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.c",
"src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.c",
@@ -14987,7 +14996,6 @@
"src/core/channel/context.h",
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h",
- "src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h",
"src/core/client_config/connector.h",
@@ -15128,8 +15136,6 @@
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.c",
"src/core/channel/http_server_filter.h",
- "src/core/channel/noop_filter.c",
- "src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.c",
"src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.c",
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index 841dc9ca38..6ec1955cff 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -11,6 +11,24 @@
"exclude_configs": [],
"flaky": false,
"language": "c",
+ "name": "alloc_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ]
+ },
+ {
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "exclude_configs": [],
+ "flaky": false,
+ "language": "c",
"name": "alpn_test",
"platforms": [
"linux",