mirror of https://github.com/grpc/grpc.git
parent
96bcf021ad
commit
320bd61499
8 changed files with 233 additions and 120 deletions
@ -0,0 +1,82 @@ |
||||
#!/bin/bash |
||||
# 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. |
||||
# |
||||
# This script is invoked by run_jekins.sh. It contains the test logic |
||||
# that should run inside a docker container. |
||||
set -e |
||||
|
||||
mkdir -p /var/local/git |
||||
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc |
||||
|
||||
cd /var/local/git/grpc |
||||
nvm use 0.12 |
||||
rvm use ruby-2.1 |
||||
|
||||
# TODO(jtattermusch): use cleaner way to install root certs |
||||
mkdir -p /usr/local/share/grpc |
||||
cp etc/roots.pem /usr/local/share/grpc/ |
||||
|
||||
# build C++ interop client & server |
||||
make interop_client interop_server |
||||
|
||||
# build C# interop client & server |
||||
make install_grpc_csharp_ext |
||||
(cd src/csharp && mono /var/local/NuGet.exe restore Grpc.sln) |
||||
(cd src/csharp && xbuild Grpc.sln) |
||||
|
||||
# build Node interop client & server |
||||
npm install -g node-gyp |
||||
make install_c -C /var/local/git/grpc |
||||
(cd src/node && npm install && node-gyp rebuild) |
||||
|
||||
# build Ruby interop client and server |
||||
(cd src/ruby && gem update bundler && bundle && rake compile:grpc) |
||||
|
||||
# TODO(jtattermusch): add python |
||||
|
||||
# build PHP interop client |
||||
# TODO(jtattermusch): make php work |
||||
# TODO(jtattermusch): prerequisites should be installed sooner than here. |
||||
# Install composer |
||||
#curl -sS https://getcomposer.org/installer | php |
||||
#mv composer.phar /usr/local/bin/composer |
||||
# Download the patched PHP protobuf so that PHP gRPC clients can be generated |
||||
# from proto3 schemas. |
||||
#git clone https://github.com/stanley-cheung/Protobuf-PHP.git /var/local/git/protobuf-php |
||||
#(cd src/php/ext/grpc && phpize && ./configure && make) |
||||
#rvm all do gem install ronn rake |
||||
#(cd /var/local/git/protobuf-php \ |
||||
# && rvm all do rake pear:package version=1.0 \ |
||||
# && pear install Protobuf-1.0.tgz) |
||||
#(cd src/php && composer install) |
||||
#(cd src/php && protoc-gen-php -i tests/interop/ -o tests/interop/ tests/interop/test.proto) |
||||
|
||||
# run the cloud-to-prod interop tests |
||||
tools/run_tests/run_interop_tests.py -l $language |
@ -0,0 +1,59 @@ |
||||
#!/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. |
||||
# |
||||
# This script can be used to run dockerized tests that normally run |
||||
# on Jenkins on your local machine using the working copy that |
||||
# is currently checked out locally. |
||||
|
||||
# IMPORTANT: The changes to be tested need to be committed locally, |
||||
# otherwise they won't be cloned inside the docker container. |
||||
set -e |
||||
|
||||
cd `dirname $0`/../.. |
||||
|
||||
#TODO(jtattermusch): provide way to tunnel run_tests cmdline options to run_tests. |
||||
#TODO(jtattermusch): provide way to grab the docker image built by run_jenkins |
||||
|
||||
# config: opt or dbg |
||||
export config=opt |
||||
|
||||
# platform: |
||||
# -- use linux to run tests under docker |
||||
# -- use interop to run dockerized interop tests |
||||
export platform=interop |
||||
|
||||
# language: one of languages supported by run_tests.py |
||||
export language=all |
||||
|
||||
# architecture |
||||
export arch=`uname -m` |
||||
|
||||
# test run configuration is done through environment variables above |
||||
tools/jenkins/run_jenkins.sh |
@ -0,0 +1,78 @@ |
||||
#!/usr/bin/env python |
||||
# 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. |
||||
|
||||
"""Run interop (cross-language) tests in parallel.""" |
||||
|
||||
import argparse |
||||
import itertools |
||||
import xml.etree.cElementTree as ET |
||||
import jobset |
||||
|
||||
# TODO(jtattermusch): add php and python once we get them working |
||||
_LANGUAGES = ['c++', 'node', 'csharp', 'ruby'] |
||||
|
||||
# TODO(jtattermusch): add empty_stream once C++ start supporting it. |
||||
# TODO(jtattermusch): add support for auth tests. |
||||
_TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong', |
||||
'client_streaming', 'server_streaming', |
||||
'cancel_after_begin', 'cancel_after_first_response', |
||||
'timeout_on_sleeping_server'] |
||||
|
||||
argp = argparse.ArgumentParser(description='Run interop tests.') |
||||
argp.add_argument('-l', '--language', |
||||
choices=['all'] + sorted(_LANGUAGES), |
||||
nargs='+', |
||||
default=['all']) |
||||
args = argp.parse_args() |
||||
|
||||
languages = [l for l in itertools.chain.from_iterable( |
||||
iter(_LANGUAGES) if x == 'all' else [x] |
||||
for x in args.language)] |
||||
|
||||
jobs = [] |
||||
jobNumber = 0 |
||||
for language in languages: |
||||
for test in _TEST_CASES: |
||||
test_job = jobset.JobSpec( |
||||
cmdline=['tools/run_tests/run_interop_test.sh', '%s' % language, '%s' % test], |
||||
shortname="cloud_to_prod:%s:%s" % (language, test), |
||||
timeout_seconds=60) |
||||
jobs.append(test_job) |
||||
jobNumber+=1 |
||||
|
||||
root = ET.Element('testsuites') |
||||
testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') |
||||
|
||||
jobset.run(jobs, maxjobs=jobNumber, xml_report=testsuite) |
||||
|
||||
tree = ET.ElementTree(root) |
||||
tree.write('report.xml', encoding='UTF-8') |
||||
|
||||
|
@ -1,37 +0,0 @@ |
||||
import argparse |
||||
import xml.etree.cElementTree as ET |
||||
import jobset |
||||
|
||||
argp = argparse.ArgumentParser(description='Run interop tests.') |
||||
argp.add_argument('-l', '--language', |
||||
default='c++') |
||||
args = argp.parse_args() |
||||
|
||||
# build job |
||||
build_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_build.sh', '%s' % args.language], |
||||
shortname='build', |
||||
timeout_seconds=30*60) |
||||
|
||||
# test jobs, each test is a separate job to run in parallel |
||||
_TESTS = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming'] |
||||
jobs = [] |
||||
jobNumber = 0 |
||||
for test in _TESTS: |
||||
test_job = jobset.JobSpec( |
||||
cmdline=['tools/run_tests/run_interops_test.sh', '%s' % args.language, '%s' % test], |
||||
shortname=test, |
||||
timeout_seconds=15*60) |
||||
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') |
||||
|
||||
|
@ -1,75 +0,0 @@ |
||||
#!/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 |
||||
|
||||
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 |
||||
|
||||
if [ "$language" = "c++" ] |
||||
then |
||||
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 |
||||
sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx |
||||
elif [ "$language" = "node" ] |
||||
then |
||||
sudo docker pull 0.0.0.0:5000/grpc/node_base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/node_base grpc/node_base |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_node |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_node |
||||
sudo docker build --no-cache -t grpc/node tools/dockerfile/grpc_node |
||||
elif [ "$language" = "ruby" ] |
||||
then |
||||
sudo docker pull 0.0.0.0:5000/grpc/ruby_base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/ruby_base grpc/ruby_base |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_ruby |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_ruby |
||||
sudo docker build --no-cache -t grpc/ruby tools/dockerfile/grpc_ruby |
||||
elif [ "$language" = "php" ] |
||||
then |
||||
sudo docker pull 0.0.0.0:5000/grpc/php_base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/php_base grpc/php_base |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_php |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_php |
||||
sudo docker build --no-cache -t grpc/php tools/dockerfile/grpc_php |
||||
else |
||||
echo "interop testss not added for $language" |
||||
exit 1 |
||||
fi |
Loading…
Reference in new issue