aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-xtools/run_tests/run_interop_tests.py165
-rwxr-xr-xtools/run_tests/run_node.sh2
-rw-r--r--tools/run_tests/sources_and_headers.json12
-rw-r--r--tools/run_tests/tests.json18
4 files changed, 110 insertions, 87 deletions
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index 80f28c544b..c2705c8cab 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -48,17 +48,6 @@ os.chdir(ROOT)
_DEFAULT_SERVER_PORT=8080
-_CLOUD_TO_PROD_BASE_ARGS = [
- '--server_host_override=grpc-test.sandbox.google.com',
- '--server_host=grpc-test.sandbox.google.com',
- '--server_port=443',
- '--use_tls=true']
-
-_CLOUD_TO_CLOUD_BASE_ARGS = [
- '--server_host_override=foo.test.google.fr',
- '--use_tls=true',
- '--use_test_ca=true']
-
# TOOD(jtattermusch) wrapped languages use this variable for location
# of roots.pem. We might want to use GRPC_DEFAULT_SSL_ROOTS_FILE_PATH
# supported by C core SslCredentials instead.
@@ -68,16 +57,12 @@ _SSL_CERT_ENV = { 'SSL_CERT_FILE':'/usr/local/share/grpc/roots.pem' }
class CXXLanguage:
def __init__(self):
- self.client_cmdline_base = ['bins/opt/interop_client']
self.client_cwd = None
self.server_cwd = None
self.safename = 'cxx'
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['bins/opt/interop_client']
def cloud_to_prod_env(self):
return {}
@@ -88,6 +73,9 @@ class CXXLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'c++'
@@ -95,16 +83,12 @@ class CXXLanguage:
class CSharpLanguage:
def __init__(self):
- self.client_cmdline_base = ['mono', 'Grpc.IntegrationTesting.Client.exe']
self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug'
self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug'
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['mono', 'Grpc.IntegrationTesting.Client.exe']
def cloud_to_prod_env(self):
return _SSL_CERT_ENV
@@ -115,6 +99,9 @@ class CSharpLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'csharp'
@@ -122,16 +109,12 @@ class CSharpLanguage:
class JavaLanguage:
def __init__(self):
- self.client_cmdline_base = ['./run-test-client.sh']
self.client_cwd = '../grpc-java'
self.server_cwd = '../grpc-java'
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['./run-test-client.sh']
def cloud_to_prod_env(self):
return {}
@@ -142,6 +125,9 @@ class JavaLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'java'
@@ -149,17 +135,13 @@ class JavaLanguage:
class GoLanguage:
def __init__(self):
- self.client_cmdline_base = ['go', 'run', 'client.go']
# TODO: this relies on running inside docker
self.client_cwd = '/go/src/google.golang.org/grpc/interop/client'
self.server_cwd = '/go/src/google.golang.org/grpc/interop/server'
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['go', 'run', 'client.go']
def cloud_to_prod_env(self):
return {}
@@ -170,6 +152,9 @@ class GoLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'go'
@@ -177,16 +162,12 @@ class GoLanguage:
class NodeLanguage:
def __init__(self):
- self.client_cmdline_base = ['node', 'src/node/interop/interop_client.js']
self.client_cwd = None
self.server_cwd = None
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['node', 'src/node/interop/interop_client.js']
def cloud_to_prod_env(self):
return _SSL_CERT_ENV
@@ -197,6 +178,9 @@ class NodeLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'node'
@@ -204,15 +188,11 @@ class NodeLanguage:
class PHPLanguage:
def __init__(self):
- self.client_cmdline_base = ['src/php/bin/interop_client.sh']
self.client_cwd = None
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['src/php/bin/interop_client.sh']
def cloud_to_prod_env(self):
return _SSL_CERT_ENV
@@ -220,6 +200,9 @@ class PHPLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'php'
@@ -227,16 +210,12 @@ class PHPLanguage:
class RubyLanguage:
def __init__(self):
- self.client_cmdline_base = ['ruby', 'src/ruby/bin/interop/interop_client.rb']
self.client_cwd = None
self.server_cwd = None
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['ruby', 'src/ruby/bin/interop/interop_client.rb']
def cloud_to_prod_env(self):
return _SSL_CERT_ENV
@@ -247,6 +226,9 @@ class RubyLanguage:
def global_env(self):
return {}
+ def unimplemented_test_cases(self):
+ return []
+
def __str__(self):
return 'ruby'
@@ -254,16 +236,12 @@ class RubyLanguage:
class PythonLanguage:
def __init__(self):
- self.client_cmdline_base = ['python2.7_virtual_environment/bin/python', '-m', 'grpc_interop.client']
self.client_cwd = None
self.server_cwd = None
self.safename = str(self)
- def cloud_to_prod_args(self):
- return self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS
-
- def cloud_to_cloud_args(self):
- return self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS
+ def client_args(self):
+ return ['python2.7_virtual_environment/bin/python', '-m', 'grpc_interop.client']
def cloud_to_prod_env(self):
return _SSL_CERT_ENV
@@ -274,6 +252,9 @@ class PythonLanguage:
def global_env(self):
return {'LD_LIBRARY_PATH': 'libs/opt'}
+ def unimplemented_test_cases(self):
+ return ['jwt_token_creds', 'per_rpc_creds']
+
def __str__(self):
return 'python'
@@ -367,7 +348,12 @@ def _job_kill_handler(job):
def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False):
"""Creates jobspec for cloud-to-prod interop test"""
- cmdline = language.cloud_to_prod_args() + ['--test_case=%s' % test_case]
+ cmdline = language.client_args() + [
+ '--server_host_override=grpc-test.sandbox.google.com',
+ '--server_host=grpc-test.sandbox.google.com',
+ '--server_port=443',
+ '--use_tls=true',
+ '--test_case=%s' % test_case]
cwd = language.client_cwd
environ = dict(language.cloud_to_prod_env(), **language.global_env())
container_name = None
@@ -403,10 +389,13 @@ def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False):
def cloud_to_cloud_jobspec(language, test_case, server_name, server_host,
server_port, docker_image=None):
"""Creates jobspec for cloud-to-cloud interop test"""
- cmdline = bash_login_cmdline(language.cloud_to_cloud_args() +
- ['--test_case=%s' % test_case,
+ cmdline = bash_login_cmdline(language.client_args() +
+ ['--server_host_override=foo.test.google.fr',
+ '--use_tls=true',
+ '--use_test_ca=true',
+ '--test_case=%s' % test_case,
'--server_host=%s' % server_host,
- '--server_port=%s' % server_port ])
+ '--server_port=%s' % server_port])
cwd = language.client_cwd
environ = language.global_env()
if docker_image:
@@ -512,12 +501,12 @@ def fill_one_test_result(shortname, resultset, html_str):
return html_str
-def render_html_report(test_cases, client_langs, server_langs, resultset,
+def render_html_report(client_langs, server_langs, resultset,
num_failures):
"""Generate html report."""
- sorted_test_cases = sorted(test_cases)
+ sorted_test_cases = sorted(_TEST_CASES)
+ sorted_auth_test_cases = sorted(_AUTH_TEST_CASES)
sorted_client_langs = sorted(client_langs)
- print sorted_client_langs
sorted_server_langs = sorted(server_langs)
html_str = ('<!DOCTYPE html>\n'
'<html lang=\"en\">\n'
@@ -540,18 +529,18 @@ def render_html_report(test_cases, client_langs, server_langs, resultset,
html_str = ('%s<h2>Cloud to Prod</h2>\n'
'<table style=\"width:100%%\" border=\"1\">\n'
'<tr bgcolor=\"#00BFFF\">\n'
- '<th/>\n') % html_str
+ '<th>Client languages &#9658;</th>\n') % html_str
for client_lang in sorted_client_langs:
html_str = '%s<th>%s\n' % (html_str, client_lang)
html_str = '%s</tr>\n' % html_str
- for test_case in sorted_test_cases:
+ for test_case in sorted_test_cases + sorted_auth_test_cases:
html_str = '%s<tr><td><b>%s</b></td>\n' % (html_str, test_case)
for client_lang in sorted_client_langs:
- if args.cloud_to_prod:
+ if not test_case in sorted_auth_test_cases:
shortname = 'cloud_to_prod:%s:%s' % (client_lang, test_case)
else:
shortname = 'cloud_to_prod_auth:%s:%s' % (client_lang, test_case)
- html_str = fill_one_test_result(shortname, resultset, html_str)
+ html_str = fill_one_test_result(shortname, resultset, html_str)
html_str = '%s</tr>\n' % html_str
html_str = '%s</table>\n' % html_str
if servers:
@@ -560,7 +549,8 @@ def render_html_report(test_cases, client_langs, server_langs, resultset,
html_str = ('%s<h2>%s</h2>\n'
'<table style=\"width:100%%\" border=\"1\">\n'
'<tr bgcolor=\"#00BFFF\">\n'
- '<th/>\n') % (html_str, test_case)
+ '<th>Client languages &#9658;<br/>'
+ 'Server languages &#9660;</th>\n') % (html_str, test_case)
for client_lang in sorted_client_langs:
html_str = '%s<th>%s\n' % (html_str, client_lang)
html_str = '%s</tr>\n' % html_str
@@ -704,17 +694,19 @@ try:
if args.cloud_to_prod:
for language in languages:
for test_case in _TEST_CASES:
- test_job = cloud_to_prod_jobspec(language, test_case,
- docker_image=docker_images.get(str(language)))
- jobs.append(test_job)
+ if not test_case in language.unimplemented_test_cases():
+ test_job = cloud_to_prod_jobspec(language, test_case,
+ docker_image=docker_images.get(str(language)))
+ jobs.append(test_job)
if args.cloud_to_prod_auth:
for language in languages:
for test_case in _AUTH_TEST_CASES:
- test_job = cloud_to_prod_jobspec(language, test_case,
- docker_image=docker_images.get(str(language)),
- auth=True)
- jobs.append(test_job)
+ if not test_case in language.unimplemented_test_cases():
+ test_job = cloud_to_prod_jobspec(language, test_case,
+ docker_image=docker_images.get(str(language)),
+ auth=True)
+ jobs.append(test_job)
for server in args.override_server:
server_name = server[0]
@@ -725,13 +717,14 @@ try:
(server_host, server_port) = server_address
for language in languages:
for test_case in _TEST_CASES:
- test_job = cloud_to_cloud_jobspec(language,
- test_case,
- server_name,
- server_host,
- server_port,
- docker_image=docker_images.get(str(language)))
- jobs.append(test_job)
+ if not test_case in language.unimplemented_test_cases():
+ test_job = cloud_to_cloud_jobspec(language,
+ test_case,
+ server_name,
+ server_host,
+ server_port,
+ docker_image=docker_images.get(str(language)))
+ jobs.append(test_job)
if not jobs:
print 'No jobs to run.'
@@ -753,7 +746,7 @@ try:
tree.write('report.xml', encoding='UTF-8')
# Generate HTML report.
- render_html_report(_TEST_CASES, set([str(l) for l in languages]), servers,
+ render_html_report(set([str(l) for l in languages]), servers,
resultset, num_failures)
finally:
diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh
index d0a74e7e1e..fff579fab8 100755
--- a/tools/run_tests/run_node.sh
+++ b/tools/run_tests/run_node.sh
@@ -51,5 +51,5 @@ then
echo '<html><head><meta http-equiv="refresh" content="0;URL=lcov-report/index.html"></head></html>' > \
../reports/node_coverage/index.html
else
- ./node_modules/mocha/bin/mocha --timeout 8000 src/node/test
+ JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 ./node_modules/.bin/mocha --reporter mocha-jenkins-reporter src/node/test || true
fi
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index 1fb1da2239..0f4e4874b7 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -237,6 +237,18 @@
],
"headers": [],
"language": "c",
+ "name": "gpr_cpu_test",
+ "src": [
+ "test/core/support/cpu_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
"name": "gpr_env_test",
"src": [
"test/core/support/env_test.c"
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index 8a3a3b792e..b03e952c89 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -235,6 +235,24 @@
"exclude_configs": [],
"flaky": false,
"language": "c",
+ "name": "gpr_cpu_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ]
+ },
+ {
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "exclude_configs": [],
+ "flaky": false,
+ "language": "c",
"name": "gpr_env_test",
"platforms": [
"linux",