diff options
Diffstat (limited to 'tools/jenkins')
-rwxr-xr-x | tools/jenkins/build_docker_and_run_tests.sh | 2 | ||||
-rwxr-xr-x | tools/jenkins/docker_run_tests.sh | 6 | ||||
-rw-r--r-- | tools/jenkins/grpc_interop_php/Dockerfile | 18 | ||||
-rwxr-xr-x | tools/jenkins/grpc_interop_php/build_interop.sh | 10 | ||||
-rwxr-xr-x | tools/jenkins/run_jenkins.sh | 7 | ||||
-rwxr-xr-x | tools/jenkins/run_performance.sh | 55 |
6 files changed, 81 insertions, 17 deletions
diff --git a/tools/jenkins/build_docker_and_run_tests.sh b/tools/jenkins/build_docker_and_run_tests.sh index b44c380533..4ab9909f9f 100755 --- a/tools/jenkins/build_docker_and_run_tests.sh +++ b/tools/jenkins/build_docker_and_run_tests.sh @@ -82,7 +82,7 @@ then fi docker cp "$CONTAINER_NAME:/var/local/git/grpc/reports.zip" $git_root || true -unzip $git_root/reports.zip -d $git_root || true +unzip -o $git_root/reports.zip -d $git_root || true rm -f reports.zip # remove the container, possibly killing it first diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh index 8bafeea620..148a0f5e08 100755 --- a/tools/jenkins/docker_run_tests.sh +++ b/tools/jenkins/docker_run_tests.sh @@ -48,7 +48,9 @@ rvm use ruby-2.1 mkdir -p reports -$RUN_TESTS_COMMAND +exit_code=0 + +$RUN_TESTS_COMMAND || exit_code=$? cd reports echo '<html><head></head><body>' > index.html @@ -61,3 +63,5 @@ echo '</body></html>' >> index.html cd .. zip -r reports.zip reports + +exit $exit_code diff --git a/tools/jenkins/grpc_interop_php/Dockerfile b/tools/jenkins/grpc_interop_php/Dockerfile index 09da713691..078089424b 100644 --- a/tools/jenkins/grpc_interop_php/Dockerfile +++ b/tools/jenkins/grpc_interop_php/Dockerfile @@ -100,5 +100,23 @@ RUN /bin/bash -l -c "rvm all do gem install ronn rake" RUN curl -sS https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer +# attempt to force a rebuild of the docker image after this point because +# Protobuf-PHP codegen has been updated +RUN echo 1 + +# Download the patched PHP protobuf so that PHP gRPC clients can be generated +# from proto3 schemas. +RUN git clone https://github.com/stanley-cheung/Protobuf-PHP.git /var/local/git/protobuf-php + +RUN /bin/bash -l -c "rvm use ruby-2.1 \ + && cd /var/local/git/protobuf-php \ + && rvm all do rake pear:package version=1.0 \ + && pear install Protobuf-1.0.tgz" + +# As an attempt to work around #4212, try to prefetch Protobuf-PHP dependency +# into composer cache to prevent "composer install" from cloning on each build. +RUN git clone --mirror https://github.com/stanley-cheung/Protobuf-PHP.git \ + /root/.composer/cache/vcs/git-github.com-stanley-cheung-Protobuf-PHP.git/ + # Define the default command. CMD ["bash"] diff --git a/tools/jenkins/grpc_interop_php/build_interop.sh b/tools/jenkins/grpc_interop_php/build_interop.sh index cd9d67804a..87262f1d62 100755 --- a/tools/jenkins/grpc_interop_php/build_interop.sh +++ b/tools/jenkins/grpc_interop_php/build_interop.sh @@ -29,7 +29,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Builds PHP interop server and client in a base image. -set -e +set -ex mkdir -p /var/local/git git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc @@ -45,18 +45,10 @@ make install-certs # gRPC core and protobuf need to be installed make install -# 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) (cd third_party/protobuf && make install) -(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) diff --git a/tools/jenkins/run_jenkins.sh b/tools/jenkins/run_jenkins.sh index 0e1af2a2a9..4bb6c39a1c 100755 --- a/tools/jenkins/run_jenkins.sh +++ b/tools/jenkins/run_jenkins.sh @@ -63,7 +63,7 @@ then # Prevent msbuild from picking up "platform" env variable, which would break the build unset platform - python tools/run_tests/run_tests.py -t -l $language -x report.xml $@ || true + python tools/run_tests/run_tests.py -t -l $language -c $config -x report.xml $@ || true elif [ "$platform" == "macos" ] then @@ -77,11 +77,6 @@ then MAKE=gmake ./tools/run_tests/run_tests.py -t -l $language -c $config -x report.xml $@ || true -elif [ "$platform" == "interop" ] -then - echo "building interop tests for language $language" - - ./tools/run_tests/run_interop_tests.py --use_docker -t -l $language --cloud_to_prod --server all || true else echo "Unknown platform $platform" exit 1 diff --git a/tools/jenkins/run_performance.sh b/tools/jenkins/run_performance.sh new file mode 100755 index 0000000000..d7e73d4272 --- /dev/null +++ b/tools/jenkins/run_performance.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env 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 Jenkins and runs performance smoke test. +set -ex + +# Enter the gRPC repo root +cd $(dirname $0)/../.. + +[[ $* =~ '--latency_profile' ]] \ + && tools/profiling/latency_profile/run_latency_profile.sh \ + || true + +config=opt + +make CONFIG=$config qps_worker qps_driver -j8 + +bins/$config/qps_worker -driver_port 10000 & +PID1=$! +bins/$config/qps_worker -driver_port 10010 & +PID2=$! + +export QPS_WORKERS="localhost:10000,localhost:10010" + +bins/$config/qps_driver + +kill -2 $PID1 $PID2 +wait |