aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-07-29 18:09:47 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-07-29 18:09:47 -0700
commit1aceadd92cd72064f6a8e6d2646e83f130131a92 (patch)
tree63f35f7cfff7fa20c682490d756ec436ab3c71f3 /tools/run_tests
parentf0295cb88598ccc7428ad67d8d7bddbc29620152 (diff)
parent7b582f6229c8ca784d4b0b7cf9727ca6af71c0a7 (diff)
Merge github.com:grpc/grpc into yeah-we-know-what-youre-talking-about
Conflicts: src/core/channel/http_client_filter.c src/core/surface/channel.c
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-xtools/run_tests/jobset.py2
-rwxr-xr-xtools/run_tests/run_interops.py36
-rwxr-xr-xtools/run_tests/run_interops_build.sh47
-rwxr-xr-xtools/run_tests/run_interops_test.sh43
-rwxr-xr-xtools/run_tests/run_tests.py2
5 files changed, 128 insertions, 2 deletions
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 46137f01f4..ec25b47610 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -206,7 +206,7 @@ class Job(object):
do_newline=self._newline_on_success or self._travis)
if self._bin_hash:
update_cache.finished(self._spec.identity(), self._bin_hash)
- elif self._state == _RUNNING and time.time() - self._start > 600:
+ elif self._state == _RUNNING and time.time() - self._start > 900:
self._tempfile.seek(0)
stdout = self._tempfile.read()
filtered_stdout = filter(lambda x: x in string.printable, stdout.decode(errors='ignore'))
diff --git a/tools/run_tests/run_interops.py b/tools/run_tests/run_interops.py
new file mode 100755
index 0000000000..1cf268526d
--- /dev/null
+++ b/tools/run_tests/run_interops.py
@@ -0,0 +1,36 @@
+import argparse
+import xml.etree.cElementTree as ET
+import jobset
+
+argp = argparse.ArgumentParser(description='Run interop tests.')
+argp.add_argument('-l', '--language',
+ choices=['build_only', 'c++'],
+ nargs='+',
+ default=['build_only'])
+args = argp.parse_args()
+
+# build job
+build_steps = 'tools/run_tests/run_interops_build.sh'
+build_job = jobset.JobSpec(cmdline=build_steps, shortname='build')
+
+# test jobs
+_TESTS = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming']
+jobs = []
+jobNumber = 0
+for lang in args.language:
+ for test in _TESTS:
+ test_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_test.sh', '%s' % lang, '%s' % test], shortname=test)
+ jobs.append(test_job)
+ jobNumber+=1
+
+root = ET.Element('testsuites')
+testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests')
+
+# always do the build of docker first, and then all the tests can run in parallel
+jobset.run([build_job], maxjobs=1, xml_report=testsuite)
+jobset.run(jobs, maxjobs=jobNumber, xml_report=testsuite)
+
+tree = ET.ElementTree(root)
+tree.write('report.xml', encoding='UTF-8')
+
+
diff --git a/tools/run_tests/run_interops_build.sh b/tools/run_tests/run_interops_build.sh
new file mode 100755
index 0000000000..23441a5300
--- /dev/null
+++ b/tools/run_tests/run_interops_build.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+set -e
+
+#clean up any old docker files and start mirroring repository if not started already
+sudo docker rmi -f grpc/cxx || true
+sudo docker rmi -f grpc/base || true
+sudo docker rmi -f 0.0.0.0:5000/grpc/base || true
+sudo docker run -d -e GCS_BUCKET=docker-interop-images -e STORAGE_PATH=/admin/docker_images -p 5000:5000 google/docker-registry || true
+
+#prepare building by pulling down base images and necessary files
+sudo docker pull 0.0.0.0:5000/grpc/base
+sudo docker tag -f 0.0.0.0:5000/grpc/base grpc/base
+gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_cxx
+gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_cxx
+
+#build docker file, add more languages later
+sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx
diff --git a/tools/run_tests/run_interops_test.sh b/tools/run_tests/run_interops_test.sh
new file mode 100755
index 0000000000..1d0eedad85
--- /dev/null
+++ b/tools/run_tests/run_interops_test.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+language=$1
+test_case=$2
+
+set -e
+if [ "$language" = "c++" ]
+then
+ sudo docker run grpc/cxx /var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots --server_host_override=grpc-test.sandbox.google.com --server_host=grpc-test.sandbox.google.com --server_port=443 --test_case=$test_case
+else
+ echo "interop testss not added for $language"
+ exit 1
+fi
+
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 77cc02a087..28980c14a8 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -458,7 +458,7 @@ if platform.system() == 'Windows':
cwd='vsprojects', shell=True)
else:
def make_jobspec(cfg, targets):
- return jobset.JobSpec(['make',
+ return jobset.JobSpec([os.getenv('MAKE', 'make'),
'-j', '%d' % (multiprocessing.cpu_count() + 1),
'EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f' %
args.slowdown,