mirror of https://github.com/grpc/grpc.git
First effort in adding interop to jenkins work flow, more languages will follow.pull/2681/head
parent
2aff2b449f
commit
1b0e3437be
5 changed files with 129 additions and 2 deletions
@ -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') |
||||||
|
|
||||||
|
|
@ -0,0 +1,46 @@ |
|||||||
|
#!/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 |
||||||
|
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 |
||||||
|
|
||||||
|
#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 |
@ -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 |
||||||
|
|
Loading…
Reference in new issue