diff options
Diffstat (limited to 'tools')
65 files changed, 431 insertions, 223 deletions
diff --git a/tools/distrib/build_ruby_environment_macos.sh b/tools/distrib/build_ruby_environment_macos.sh new file mode 100644 index 0000000000..ff3a388eaf --- /dev/null +++ b/tools/distrib/build_ruby_environment_macos.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# Copyright 2015-2016, 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 -ex + +rm -rf ~/.rake-compiler + +CROSS_RUBY=`mktemp tmpfile.XXXXXXXX` + +curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v0.9.5/tasks/bin/cross-ruby.rake > $CROSS_RUBY + +patch $CROSS_RUBY << EOF +--- cross-ruby.rake 2016-02-05 16:26:53.000000000 -0800 ++++ cross-ruby.rake.patched 2016-02-05 16:27:33.000000000 -0800 +@@ -133,7 +133,8 @@ + "--host=#{MINGW_HOST}", + "--target=#{MINGW_TARGET}", + "--build=#{RUBY_BUILD}", +- '--enable-shared', ++ '--enable-static', ++ '--disable-shared', + '--disable-install-doc', + '--without-tk', + '--without-tcl' +EOF + +MAKE="make -j8" + +for v in 2.3.0 2.2.2 2.1.5 2.0.0-p645 ; do + rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11 +done + +sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > $CROSS_RUBY +mv $CROSS_RUBY ~/.rake-compiler/config.yml diff --git a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile index 17e9698904..03b5b364f8 100644 --- a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile @@ -33,6 +33,5 @@ RUN rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E03 RUN yum-config-manager --add-repo http://download.mono-project.com/repo/centos/ RUN yum install -y mono -RUN yum install -y git RUN yum install -y unzip RUN yum install -y nuget diff --git a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile index 840ecf0fc2..1cadba3b7b 100644 --- a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile @@ -40,4 +40,4 @@ RUN apt-get update && apt-get install -y \ ca-certificates-mono \ nuget -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile index 3a50da4936..be962828c2 100644 --- a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile @@ -40,4 +40,4 @@ RUN apt-get update && apt-get install -y \ ca-certificates-mono \ nuget -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile index 901c981acb..3d04d032b5 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile @@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \ ca-certificates-mono \ nuget -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile index 1b8d454681..5eec570491 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile @@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \ ca-certificates-mono \ nuget -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile index a6c26a4b9e..a6d60fb4b9 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile @@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \ ca-certificates-mono \ nuget -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile index c6a8634937..61472704d7 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile @@ -34,4 +34,4 @@ RUN apt-get update && apt-get install -y \ ca-certificates-mono \ nuget -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile index dd865e8bbc..9039c3c509 100644 --- a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile @@ -29,4 +29,4 @@ FROM mono:4.2.2.30 -RUN apt-get update && apt-get install -y git unzip +RUN apt-get update && apt-get install -y unzip diff --git a/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile index 9c1f5ee729..f6e1664086 100644 --- a/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile @@ -29,7 +29,6 @@ FROM centos:7 -RUN yum install -y git RUN yum install -y curl # Install nvm diff --git a/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile index 69a071500e..4ca5e86563 100644 --- a/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile @@ -29,7 +29,7 @@ FROM debian:jessie -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile diff --git a/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile index 173c70360d..8b97d8bb5a 100644 --- a/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile +++ b/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile @@ -29,8 +29,8 @@ FROM 32bit/debian:jessie -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
\ No newline at end of file +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash diff --git a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile index c53a4aa305..0134dc964e 100644 --- a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile @@ -29,7 +29,7 @@ FROM ubuntu:12.04 -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile diff --git a/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile index 8fe6ae1f33..0fae447946 100644 --- a/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile @@ -29,7 +29,7 @@ FROM ubuntu:14.04 -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile diff --git a/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile index 013c2a0c72..55da46c3be 100644 --- a/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile @@ -29,7 +29,7 @@ FROM ubuntu:15.04 -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile diff --git a/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile index 43b3ae2738..c050cab7d3 100644 --- a/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile @@ -29,7 +29,7 @@ FROM ubuntu:15.10 -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile diff --git a/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile index 3eae75475c..ab9e8a32e3 100644 --- a/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile @@ -29,7 +29,7 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y curl git +RUN apt-get update && apt-get install -y curl # Install nvm RUN touch .profile diff --git a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile index 4d10e240c6..c4f2431080 100644 --- a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile @@ -30,7 +30,7 @@ FROM base/archlinux RUN pacman --noconfirm -Syy -RUN pacman --noconfirm -S git -RUN pacman --noconfirm -S python -RUN pacman --noconfirm -S python-pip +RUN pacman --noconfirm -S openssl +RUN pacman --noconfirm -S python2 +RUN pacman --noconfirm -S python2-pip diff --git a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile index 683686c6db..99306bb403 100644 --- a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile @@ -29,9 +29,10 @@ FROM centos:6 -RUN yum install -y git RUN yum install -y python RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm RUN yum install -y python-pip +RUN pip install --upgrade pip + diff --git a/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile index 6b70f65f10..114957b573 100644 --- a/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile @@ -29,7 +29,6 @@ FROM centos:7 -RUN yum install -y git RUN yum install -y python RUN yum install -y epel-release RUN yum install -y python-pip diff --git a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile index 1c91594363..d58036410f 100644 --- a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile @@ -29,9 +29,4 @@ FROM fedora:20 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y python -RUN yum install -y python-pip - +RUN yum clean all && yum update -y && yum install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile index e35de109ea..b44fcff7e3 100644 --- a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile @@ -29,9 +29,4 @@ FROM fedora:21 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y python -RUN yum install -y python-pip - +RUN yum clean all && yum update -y && yum install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile index 69c3b541d3..c6415946c3 100644 --- a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile @@ -29,9 +29,4 @@ FROM fedora:22 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y python -RUN yum install -y python-pip - +RUN yum clean all && yum update -y && yum install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile index 74639a3118..6c834d2bc2 100644 --- a/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile @@ -29,9 +29,4 @@ FROM fedora:23 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y python -RUN yum install -y python-pip - +RUN yum clean all && yum update -y && yum install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile index 3d511e267a..5778d604c8 100644 --- a/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile @@ -29,6 +29,4 @@ FROM debian:jessie -RUN apt-get update -RUN apt-get install -y git python python-pip - +RUN apt-get update && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile index 035d56b655..e9cf99142b 100644 --- a/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile +++ b/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile @@ -29,6 +29,9 @@ FROM 32bit/debian:jessie -RUN apt-get update -RUN apt-get install -y git python python-pip +RUN apt-get update && apt-get install -y python python-pip +# docker is running on a 64-bit machine, so we need to +# override "uname -m" to report i686 instead of x86_64, otherwise +# python will choose a wrong binary package to install. +ENTRYPOINT ["linux32"] diff --git a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile index 032beb97e5..417d9e0293 100644 --- a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile @@ -29,7 +29,5 @@ FROM opensuse:42.1 -RUN zypper --non-interactive install git RUN zypper --non-interactive install python RUN zypper --non-interactive install python-pip - diff --git a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile index 9dbf90f511..a48ce0eeef 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile @@ -29,8 +29,4 @@ FROM ubuntu:12.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y python -RUN apt-get install -y python-pip - +RUN apt-get update -y && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile index 3b366a9bb4..18dbfd4657 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile @@ -29,8 +29,4 @@ FROM ubuntu:14.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y python -RUN apt-get install -y python-pip - +RUN apt-get update -y && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile index de90b5b7e2..444a54d14b 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile @@ -29,8 +29,4 @@ FROM ubuntu:15.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y python -RUN apt-get install -y python-pip - +RUN apt-get update -y && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile index d10e04aacc..245ffb9413 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile @@ -29,8 +29,4 @@ FROM ubuntu:15.10 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y python -RUN apt-get install -y python-pip - +RUN apt-get update -y && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile index bc56285a3d..a1ac3051ba 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile @@ -29,8 +29,4 @@ FROM ubuntu:16.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y python -RUN apt-get install -y python-pip - +RUN apt-get update -y && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile index 895dd96747..46353b92d6 100644 --- a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile @@ -29,6 +29,4 @@ FROM debian:wheezy -RUN apt-get update -RUN apt-get install -y git python python-pip - +RUN apt-get update -y && apt-get install -y python python-pip diff --git a/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile index 28a5c4ad71..fd2cf63a59 100644 --- a/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile @@ -29,6 +29,4 @@ FROM centos:6 -RUN yum install -y git RUN yum install -y ruby - diff --git a/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile index bdc100ee1c..5bb9bd6fa6 100644 --- a/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile @@ -29,6 +29,4 @@ FROM centos:7 -RUN yum install -y git RUN yum install -y ruby - diff --git a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile index 50ff0b038b..9f23be986f 100644 --- a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile @@ -29,8 +29,4 @@ FROM fedora:20 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y ruby - +RUN yum clean all && yum update -y && yum install -y ruby diff --git a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile index 219ecc8b53..57106a4894 100644 --- a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile @@ -29,8 +29,4 @@ FROM fedora:21 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y ruby - +RUN yum clean all && yum update -y && yum install -y ruby diff --git a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile index 49d4c7d7f8..d770177381 100644 --- a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile @@ -29,8 +29,4 @@ FROM fedora:22 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y ruby - +RUN yum clean all && yum update -y && yum install -y ruby diff --git a/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile index 3c5363fb63..2c9b78ed08 100644 --- a/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile @@ -29,8 +29,4 @@ FROM fedora:23 -RUN yum clean all -RUN yum update -y -RUN yum install -y git -RUN yum install -y ruby - +RUN yum clean all && yum update -y && yum install -y ruby diff --git a/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile index 6a3d7edba0..4784bd73b4 100644 --- a/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile @@ -29,7 +29,4 @@ FROM debian:jessie -RUN apt-get update -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile index ca3b731f56..4f649cbc03 100644 --- a/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile @@ -29,7 +29,4 @@ FROM 32bit/debian:jessie -RUN apt-get update -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile index a9423042ea..a249950998 100644 --- a/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile @@ -29,6 +29,4 @@ FROM opensuse:42.1 -RUN zypper --non-interactive install git RUN zypper --non-interactive install ruby - diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile index 66f17100cf..95b7702afb 100644 --- a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile @@ -29,7 +29,4 @@ FROM ubuntu:12.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update -y && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile index dc533a5fca..66ba01d37e 100644 --- a/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile @@ -29,7 +29,4 @@ FROM ubuntu:14.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update -y && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile index 7e4f203041..81e7ca1d3c 100644 --- a/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile @@ -29,7 +29,4 @@ FROM ubuntu:15.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update -y && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile index 43ef63ec8c..37b897f0f5 100644 --- a/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile @@ -29,7 +29,4 @@ FROM ubuntu:15.10 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update -y && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile index 3b63976d3c..5c54b8f754 100644 --- a/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile @@ -29,7 +29,4 @@ FROM ubuntu:16.04 -RUN apt-get update -y -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update -y && apt-get install -y ruby-full diff --git a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile index 1ff083d43c..2e6593c230 100644 --- a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile @@ -29,7 +29,4 @@ FROM debian:wheezy -RUN apt-get update -RUN apt-get install -y git -RUN apt-get install -y ruby-full - +RUN apt-get update && apt-get install -y ruby-full diff --git a/tools/jenkins/build_and_run_docker.sh b/tools/jenkins/build_and_run_docker.sh index b77cd0aebb..92dbbc6f38 100755 --- a/tools/jenkins/build_and_run_docker.sh +++ b/tools/jenkins/build_and_run_docker.sh @@ -37,9 +37,6 @@ cd $(dirname $0)/../.. git_root=$(pwd) cd - -# Create a local branch so the child Docker script won't complain -git branch -f jenkins-docker - # Inputs # DOCKERFILE_DIR - Directory in which Dockerfile file is located. # DOCKER_RUN_SCRIPT - Script to run under docker (relative to grpc repo root) diff --git a/tools/jenkins/build_artifacts.sh b/tools/jenkins/build_artifacts.sh index 9af553ae48..c0acbdfb27 100755 --- a/tools/jenkins/build_artifacts.sh +++ b/tools/jenkins/build_artifacts.sh @@ -39,4 +39,8 @@ set -ex -o igncr || set -ex curr_platform="$platform" unset platform # variable named 'platform' breaks the windows build -python tools/run_tests/task_runner.py -f artifact $language $curr_platform $architecture +if [ "$curr_platform" == "linux" ] && [ "$language" == "ruby" ] ; then + ./tools/run_tests/build_artifact_ruby.sh +else + python tools/run_tests/task_runner.py -f artifact $language $curr_platform $architecture +fi diff --git a/tools/jenkins/docker_run.sh b/tools/jenkins/docker_run.sh index 49553aae2f..519dc5cade 100755 --- a/tools/jenkins/docker_run.sh +++ b/tools/jenkins/docker_run.sh @@ -31,18 +31,24 @@ # This script is invoked by build_docker_* inside a docker # container. You should never need to call this script on your own. -set -e +set -ex -mkdir -p /var/local/git -git clone --recursive "$EXTERNAL_GIT_ROOT" /var/local/git/grpc +if [ "$RELATIVE_COPY_PATH" == "" ] +then + mkdir -p /var/local/git + git clone --recursive "$EXTERNAL_GIT_ROOT" /var/local/git/grpc +else + mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH" + cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH" +fi if [ -x "$(command -v rvm)" ] then rvm use ruby-2.1 fi -cd /var/local/git/grpc - nvm use 4 || true +cd /var/local/git/grpc + $RUN_COMMAND diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh index 26e5585d2d..12874386a3 100755 --- a/tools/jenkins/docker_run_tests.sh +++ b/tools/jenkins/docker_run_tests.sh @@ -43,8 +43,6 @@ chown `whoami` $XDG_CACHE_HOME mkdir -p /var/local/git git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc -nvm use 0.12 || true - if [ -x "$(command -v rvm)" ] then rvm use ruby-2.1 diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index 48cf390f69..835fad83e1 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -39,11 +39,13 @@ then pip install -rrequirements.txt fi -GRPC_PYTHON_BUILD_WITH_CYTHON=1 ${SETARCH_CMD} python setup.py \ - bdist_wheel \ - sdist \ +GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ +GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ +${SETARCH_CMD} python setup.py \ + bdist_wheel \ + sdist \ bdist_egg_grpc_custom mkdir -p artifacts -cp -r dist/* artifacts
\ No newline at end of file +cp -r dist/* artifacts diff --git a/tools/run_tests/build_artifact_ruby.sh b/tools/run_tests/build_artifact_ruby.sh index 482d128be3..2d97b4068b 100755 --- a/tools/run_tests/build_artifact_ruby.sh +++ b/tools/run_tests/build_artifact_ruby.sh @@ -27,16 +27,40 @@ # 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 -ex +SYSTEM=`uname | cut -f 1 -d_` + cd $(dirname $0)/../.. +set +ex +[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" +set -ex + +if [ "$SYSTEM" == "MSYS" ] ; then + SYSTEM=MINGW32 +fi +if [ "$SYSTEM" == "MINGW64" ] ; then + SYSTEM=MINGW32 +fi -${SETARCH_CMD} bundle install +if [ "$SYSTEM" == "MINGW32" ] ; then + echo "Need Linux to build the Windows ruby gem." + exit 1 +fi -${SETARCH_CMD} rake native gem +set +ex +rvm use default +gem install bundler --update +bundle install +set -ex + +rake gem:native + +if [ "$SYSTEM" == "Darwin" ] ; then + rm `ls pkg/*.gem | grep -v darwin` +fi mkdir -p artifacts cp pkg/*.gem artifacts - diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/build_node.sh index 8f2ab4413a..9c4af07185 100755 --- a/tools/run_tests/build_node.sh +++ b/tools/run_tests/build_node.sh @@ -29,8 +29,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +NODE_VERSION=$1 +source ~/.nvm/nvm.sh set -ex +nvm use $NODE_VERSION + CONFIG=${CONFIG:-opt} # change to grpc repo root diff --git a/tools/run_tests/build_package_python.sh b/tools/run_tests/build_package_python.sh new file mode 100755 index 0000000000..2511a6ae46 --- /dev/null +++ b/tools/run_tests/build_package_python.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2016, 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 -ex + +cd $(dirname $0)/../.. + +mkdir -p artifacts/ + +# All the python packages have been built in the artifact phase already +# and we only collect them here to deliver them to the distribtest phase. +cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=python,platform={windows,linux,macos}/artifacts/* artifacts/ || true + +# TODO: all the artifact builder configurations generate a grpcio-VERSION.tar.gz +# source distribution package, and only one of them will end up +# in the artifacts/ directory. They should be all equivalent though. diff --git a/tools/run_tests/build_package_ruby.sh b/tools/run_tests/build_package_ruby.sh new file mode 100755 index 0000000000..1a5b94348d --- /dev/null +++ b/tools/run_tests/build_package_ruby.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2016, 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 -ex + +cd $(dirname $0)/../.. + +mkdir -p artifacts/ + +# All the ruby packages have been built in the artifact phase already +# and we only collect them here to deliver them to the distribtest phase. +cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=ruby,platform={windows,linux,macos}/artifacts/* artifacts/ || true + +# TODO: all the artifact builder configurations generate a grpc-VERSION.gem +# source distribution package, and only one of them will end up +# in the artifacts/ directory. They should be all equivalent though. diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index e9a80d2cf4..fc7dd17145 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -38,6 +38,7 @@ def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, """Creates jobspec for a task running under docker.""" environ = environ.copy() environ['RUN_COMMAND'] = shell_command + environ['RELATIVE_COPY_PATH'] = 'test/distrib' docker_args=[] for k,v in environ.iteritems(): @@ -54,28 +55,49 @@ def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, return jobspec +def create_jobspec(name, cmdline, environ=None, shell=False, + flake_retries=0, timeout_retries=0): + """Creates jobspec.""" + jobspec = jobset.JobSpec( + cmdline=cmdline, + environ=environ, + shortname='distribtest.%s' % (name), + timeout_seconds=10*60, + flake_retries=flake_retries, + timeout_retries=timeout_retries, + shell=shell) + return jobspec + + class CSharpDistribTest(object): """Tests C# NuGet package""" - def __init__(self, platform, arch, docker_suffix): - self.name = 'csharp_nuget_%s_%s_%s' % (platform, arch, docker_suffix) + def __init__(self, platform, arch, docker_suffix=None): + self.name = 'csharp_nuget_%s_%s' % (platform, arch) self.platform = platform self.arch = arch self.docker_suffix = docker_suffix - self.labels = ['distribtest', 'csharp', platform, arch, docker_suffix] + self.labels = ['distribtest', 'csharp', platform, arch] + if docker_suffix: + self.name += '_%s' % docker_suffix + self.labels.append(docker_suffix) def pre_build_jobspecs(self): return [] def build_jobspec(self): - if not self.platform == 'linux': - raise Exception("Not supported yet.") - - return create_docker_jobspec(self.name, + if self.platform == 'linux': + return create_docker_jobspec(self.name, 'tools/dockerfile/distribtest/csharp_%s_%s' % ( self.docker_suffix, self.arch), 'test/distrib/csharp/run_distrib_test.sh') + elif self.platform == 'macos': + return create_jobspec(self.name, + ['test/distrib/csharp/run_distrib_test.sh'], + environ={'EXTERNAL_GIT_ROOT': '../../..'}) + else: + raise Exception("Not supported yet.") def __str__(self): return self.name @@ -104,8 +126,7 @@ class NodeDistribTest(object): 'tools/dockerfile/distribtest/node_%s_%s' % ( self.docker_suffix, self.arch), - # bash -l needed to make nvm available - 'bash -l test/distrib/node/run_distrib_test.sh %s' % ( + 'test/distrib/node/run_distrib_test.sh %s' % ( self.node_version)) def __str__(self): return self.name @@ -175,6 +196,7 @@ def targets(): CSharpDistribTest('linux', 'x64', 'ubuntu1504'), CSharpDistribTest('linux', 'x64', 'ubuntu1510'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'), + CSharpDistribTest('macos', 'x86'), PythonDistribTest('linux', 'x64', 'wheezy'), PythonDistribTest('linux', 'x64', 'jessie'), PythonDistribTest('linux', 'x86', 'jessie'), diff --git a/tools/run_tests/interop_html_report.template b/tools/run_tests/interop_html_report.template index 114a508c31..46cce426b7 100644 --- a/tools/run_tests/interop_html_report.template +++ b/tools/run_tests/interop_html_report.template @@ -64,17 +64,8 @@ % endif </%def> -% if num_failures > 1: - <p><h2><font color="red">${num_failures} tests failed!</font></h2></p> -% elif num_failures: - <p><h2><font color="red">${num_failures} test failed!</font></h2></p> -% else: - <p><h2><font color="green">All tests passed!</font></h2></p> -% endif - -% if cloud_to_prod: +<%def name="display_cloud_to_prod_result(prod_server)"> ## Each column header is the client language. - <h2>Cloud to Prod</h2> <table style="width:100%" border="1"> <tr bgcolor="#00BFFF"> <th>Client languages ►<br/>Test Cases ▼</th> @@ -87,15 +78,32 @@ % for client_lang in client_langs: <% if test_case in auth_test_cases: - shortname = 'cloud_to_prod_auth:%s:%s' % (client_lang, test_case) + shortname = 'cloud_to_prod_auth:%s:%s:%s' % ( + prod_server, client_lang, test_case) else: - shortname = 'cloud_to_prod:%s:%s' % (client_lang, test_case) + shortname = 'cloud_to_prod:%s:%s:%s' % ( + prod_server, client_lang, test_case) %> ${fill_one_test_result(shortname, resultset)} % endfor </tr> % endfor </table> +</%def> + +% if num_failures > 1: + <p><h2><font color="red">${num_failures} tests failed!</font></h2></p> +% elif num_failures: + <p><h2><font color="red">${num_failures} test failed!</font></h2></p> +% else: + <p><h2><font color="green">All tests passed!</font></h2></p> +% endif + +% if cloud_to_prod: + % for prod_server in prod_servers: + <h2>Cloud to ${prod_server}</h2> + ${display_cloud_to_prod_result(prod_server)} + % endfor % endif % if http2_interop: @@ -108,7 +116,9 @@ <th>${server_lang}</th> % endfor % if cloud_to_prod: - <th>prod</th> + % for prod_server in prod_servers: + <th>${prod_server}</th> + % endfor % endif </tr> % for test_case in http2_cases: @@ -122,8 +132,10 @@ ${fill_one_http2_test_result(shortname, resultset)} % endfor % if cloud_to_prod: - <% shortname = 'cloud_to_prod:http2:%s' % test_case %> - ${fill_one_http2_test_result(shortname, resultset)} + % for prod_server in prod_servers: + <% shortname = 'cloud_to_prod:%s:http2:%s' % (prod_server, test_case) %> + ${fill_one_http2_test_result(shortname, resultset)} + % endfor % endif </tr> % endfor diff --git a/tools/run_tests/package_targets.py b/tools/run_tests/package_targets.py index 997bc57cc5..4ca8279f1b 100644 --- a/tools/run_tests/package_targets.py +++ b/tools/run_tests/package_targets.py @@ -68,11 +68,11 @@ def create_jobspec(name, cmdline, environ=None, cwd=None, shell=False, return jobspec -class CSharpNugetTarget: +class CSharpPackage: """Builds C# nuget packages.""" def __init__(self): - self.name = 'csharp_nuget' + self.name = 'csharp_package' self.labels = ['package', 'csharp', 'windows'] def pre_build_jobspecs(self): @@ -87,11 +87,12 @@ class CSharpNugetTarget: def __str__(self): return self.name -class NodeNpmBinaryTarget: - """Builds Node NPM package and collects binaries""" + +class NodePackage: + """Builds Node NPM package and collects precompiled binaries""" def __init__(self): - self.name = 'node_npm_binary' + self.name = 'node_package' self.labels = ['package', 'node', 'linux'] def pre_build_jobspecs(self): @@ -103,6 +104,44 @@ class NodeNpmBinaryTarget: 'tools/dockerfile/grpc_artifact_linux_x64', 'tools/run_tests/build_package_node.sh') + +class RubyPackage: + """Collects ruby gems created in the artifact phase""" + + def __init__(self): + self.name = 'ruby_package' + self.labels = ['package', 'ruby', 'linux'] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_x64', + 'tools/run_tests/build_package_ruby.sh') + + +class PythonPackage: + """Collects python eggs and wheels created in the artifact phase""" + + def __init__(self): + self.name = 'python_package' + self.labels = ['package', 'python', 'linux'] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_x64', + 'tools/run_tests/build_package_python.sh') + + def targets(): """Gets list of supported targets""" - return [CSharpNugetTarget(), NodeNpmBinaryTarget()] + return [CSharpPackage(), + NodePackage(), + RubyPackage(), + PythonPackage()] diff --git a/tools/run_tests/pre_build_node.sh b/tools/run_tests/pre_build_node.sh index 28ce354f27..11f46d60fc 100755 --- a/tools/run_tests/pre_build_node.sh +++ b/tools/run_tests/pre_build_node.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -29,8 +29,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +NODE_VERSION=$1 +source ~/.nvm/nvm.sh set -ex +nvm use $NODE_VERSION + export GRPC_CONFIG=${CONFIG:-opt} # Expire cache after 1 week diff --git a/tools/run_tests/report_utils.py b/tools/run_tests/report_utils.py index 35f2069bee..0032a98523 100644 --- a/tools/run_tests/report_utils.py +++ b/tools/run_tests/report_utils.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -77,7 +77,7 @@ def render_junit_xml_report(resultset, xml_report): def render_interop_html_report( client_langs, server_langs, test_cases, auth_test_cases, http2_cases, - resultset, num_failures, cloud_to_prod, http2_interop): + resultset, num_failures, cloud_to_prod, prod_servers, http2_interop): """Generate HTML report for interop tests.""" template_file = 'tools/run_tests/interop_html_report.template' try: @@ -94,6 +94,7 @@ def render_interop_html_report( sorted_http2_cases = sorted(http2_cases) sorted_client_langs = sorted(client_langs) sorted_server_langs = sorted(server_langs) + sorted_prod_servers = sorted(prod_servers) args = {'client_langs': sorted_client_langs, 'server_langs': sorted_server_langs, @@ -103,6 +104,7 @@ def render_interop_html_report( 'resultset': resultset, 'num_failures': num_failures, 'cloud_to_prod': cloud_to_prod, + 'prod_servers': sorted_prod_servers, 'http2_interop': http2_interop} html_report_out_dir = 'reports' diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index fbc3b3cdf6..4a670e0c9d 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -422,12 +422,13 @@ def _job_kill_handler(job): time.sleep(2) -def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False): +def cloud_to_prod_jobspec(language, test_case, server_host_name, + server_host_detail, docker_image=None, auth=False): """Creates jobspec for cloud-to-prod interop test""" container_name = None cmdargs = [ - '--server_host_override=grpc-test.sandbox.googleapis.com', - '--server_host=grpc-test.sandbox.googleapis.com', + '--server_host=%s' % server_host_detail[0], + '--server_host_override=%s' % server_host_detail[1], '--server_port=443', '--use_tls=true', '--test_case=%s' % test_case] @@ -440,7 +441,8 @@ def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False): cwd = language.client_cwd if docker_image: - container_name = dockerjob.random_name('interop_client_%s' % language.safename) + container_name = dockerjob.random_name('interop_client_%s' % + language.safename) cmdline = docker_run_cmdline(cmdline, image=docker_image, cwd=cwd, @@ -455,7 +457,8 @@ def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False): cmdline=cmdline, cwd=cwd, environ=environ, - shortname='%s:%s:%s' % (suite_name, language, test_case), + shortname='%s:%s:%s:%s' % (suite_name, server_host_name, language, + test_case), timeout_seconds=90, flake_retries=5 if args.allow_flakes else 0, timeout_retries=2 if args.allow_flakes else 0, @@ -491,7 +494,7 @@ def cloud_to_cloud_jobspec(language, test_case, server_name, server_host, cwd=cwd, environ=environ, shortname='cloud_to_cloud:%s:%s_server:%s' % (language, server_name, - test_case), + test_case), timeout_seconds=90, flake_retries=5 if args.allow_flakes else 0, timeout_retries=2 if args.allow_flakes else 0, @@ -572,6 +575,21 @@ def aggregate_http2_results(stdout): 'percent': 1.0 * passed / (passed + failed) } +# A dictionary of prod servers to test. +# Format: server_name: (server_host, server_host_override, errors_allowed) +# TODO(adelez): implement logic for errors_allowed where if the indicated tests +# fail, they don't impact the overall test result. +prod_servers = { + 'default': ('grpc-test.sandbox.googleapis.com', + 'grpc-test.sandbox.googleapis.com', False), + 'gateway_v2': ('grpc-test2.sandbox.googleapis.com', + 'grpc-test2.sandbox.googleapis.com', True), + 'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com', + False), + 'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com', + True) +} + argp = argparse.ArgumentParser(description='Run interop tests.') argp.add_argument('-l', '--language', choices=['all'] + sorted(_LANGUAGES), @@ -589,6 +607,12 @@ argp.add_argument('--cloud_to_prod_auth', action='store_const', const=True, help='Run cloud_to_prod_auth tests.') +argp.add_argument('--prod_servers', + choices=prod_servers.keys(), + default=['default'], + nargs='+', + help=('The servers to run cloud_to_prod and ' + 'cloud_to_prod_auth tests against.')) argp.add_argument('-s', '--server', choices=['all'] + sorted(_SERVERS), action='append', @@ -688,32 +712,37 @@ try: server_jobs[lang] = job server_addresses[lang] = ('localhost', job.mapped_port(_DEFAULT_SERVER_PORT)) - jobs = [] if args.cloud_to_prod: - for language in languages: - for test_case in _TEST_CASES: - if not test_case in language.unimplemented_test_cases(): - if not test_case in _SKIP_ADVANCED + _SKIP_COMPRESSION: - test_job = cloud_to_prod_jobspec(language, test_case, - docker_image=docker_images.get(str(language))) - jobs.append(test_job) - - if args.http2_interop: - for test_case in _HTTP2_TEST_CASES: - test_job = cloud_to_prod_jobspec(http2Interop, test_case, - docker_image=docker_images.get(str(http2Interop))) - jobs.append(test_job) - + for server_host_name in args.prod_servers: + for language in languages: + for test_case in _TEST_CASES: + if not test_case in language.unimplemented_test_cases(): + if not test_case in _SKIP_ADVANCED + _SKIP_COMPRESSION: + test_job = cloud_to_prod_jobspec( + language, test_case, server_host_name, + prod_servers[server_host_name], + docker_image=docker_images.get(str(language))) + jobs.append(test_job) + + if args.http2_interop: + for test_case in _HTTP2_TEST_CASES: + test_job = cloud_to_prod_jobspec( + http2Interop, test_case, server_host_name, + prod_servers[server_host_name], + docker_image=docker_images.get(str(http2Interop))) + jobs.append(test_job) if args.cloud_to_prod_auth: - for language in languages: - for test_case in _AUTH_TEST_CASES: - 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_host_name in args.prod_servers: + for language in languages: + for test_case in _AUTH_TEST_CASES: + if not test_case in language.unimplemented_test_cases(): + test_job = cloud_to_prod_jobspec( + language, test_case, server_host_name, + prod_servers[server_host_name], + docker_image=docker_images.get(str(language)), auth=True) + jobs.append(test_job) for server in args.override_server: server_name = server[0] @@ -773,7 +802,8 @@ try: report_utils.render_interop_html_report( set([str(l) for l in languages]), servers, _TEST_CASES, _AUTH_TEST_CASES, _HTTP2_TEST_CASES, resultset, num_failures, - args.cloud_to_prod_auth or args.cloud_to_prod, args.http2_interop) + args.cloud_to_prod_auth or args.cloud_to_prod, args.prod_servers, + args.http2_interop) finally: # Check if servers are still running. diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index f93c9c30cb..40f61d77cc 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -28,8 +28,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +NODE_VERSION=$1 +source ~/.nvm/nvm.sh set -ex +nvm use $NODE_VERSION + CONFIG=${CONFIG:-opt} # change to grpc repo root diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 9e7b97c6a2..6dfdc705be 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -194,13 +194,17 @@ class CLanguage(object): class NodeLanguage(object): + def __init__(self): + self.node_version = '0.12' + def test_specs(self, config, args): - return [config.job_spec(['tools/run_tests/run_node.sh'], None, + return [config.job_spec(['tools/run_tests/run_node.sh', self.node_version], + None, environ=_FORCE_ENVIRON_FOR_WRAPPERS)] def pre_build_steps(self): # Default to 1 week cache expiration - return [['tools/run_tests/pre_build_node.sh']] + return [['tools/run_tests/pre_build_node.sh', self.node_version]] def make_targets(self, test_regex): return [] @@ -209,7 +213,7 @@ class NodeLanguage(object): return [] def build_steps(self): - return [['tools/run_tests/build_node.sh']] + return [['tools/run_tests/build_node.sh', self.node_version]] def post_tests_steps(self): return [] |