From 788ee23ab3171da1db0aa9c6c250e0fd2eaaebc8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 26 Jan 2016 12:19:44 -0800 Subject: cleanup sanity tests --- tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile | 2 - tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile | 2 - tools/dockerfile/grpc_sanity/Dockerfile | 92 ++++++++++++++++++++++ tools/jenkins/docker_run_tests.sh | 10 ++- tools/run_tests/check_cache_mk.sh | 39 --------- tools/run_tests/check_sources_and_headers.py | 83 ------------------- tools/run_tests/check_submodules.sh | 54 ------------- tools/run_tests/run_tests.py | 59 +++++++++++--- tools/run_tests/sanity/check_cache_mk.sh | 39 +++++++++ .../run_tests/sanity/check_sources_and_headers.py | 83 +++++++++++++++++++ tools/run_tests/sanity/check_submodules.sh | 54 +++++++++++++ tools/run_tests/sanity/sanity_tests.yaml | 9 +++ tools/run_tests/sanity_tests.yaml | 9 --- 13 files changed, 331 insertions(+), 204 deletions(-) create mode 100644 tools/dockerfile/grpc_sanity/Dockerfile delete mode 100755 tools/run_tests/check_cache_mk.sh delete mode 100755 tools/run_tests/check_sources_and_headers.py delete mode 100755 tools/run_tests/check_submodules.sh create mode 100755 tools/run_tests/sanity/check_cache_mk.sh create mode 100755 tools/run_tests/sanity/check_sources_and_headers.py create mode 100755 tools/run_tests/sanity/check_submodules.sh create mode 100644 tools/run_tests/sanity/sanity_tests.yaml delete mode 100644 tools/run_tests/sanity_tests.yaml diff --git a/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile b/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile index 48541b00ad..ad11733b7d 100644 --- a/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile +++ b/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile @@ -95,8 +95,6 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ RUN cd /var/local && wget www.nuget.org/NuGet.exe ENV NUGET mono /var/local/NuGet.exe -# TODO(jtattermusch): add dependencies for other languages - ################## # Node dependencies diff --git a/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile b/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile index 2323f23387..067c209db7 100644 --- a/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile +++ b/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile @@ -95,8 +95,6 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ RUN cd /var/local && wget www.nuget.org/NuGet.exe ENV NUGET mono /var/local/NuGet.exe -# TODO(jtattermusch): add dependencies for other languages - ################## # Node dependencies diff --git a/tools/dockerfile/grpc_sanity/Dockerfile b/tools/dockerfile/grpc_sanity/Dockerfile new file mode 100644 index 0000000000..87b3a7a81f --- /dev/null +++ b/tools/dockerfile/grpc_sanity/Dockerfile @@ -0,0 +1,92 @@ +# 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. + +# A work-in-progress Dockerfile that allows running gRPC test suites +# inside a docker container. + +FROM debian:jessie + +# Install Git and basic packages. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + golang \ + gyp \ + lcov \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + perl \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################## +# C++ dependencies +RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang + +################## +# Sanity test dependencies +RUN apt-get update && apt-get install -y python-pip +RUN pip install simplejson mako + +################## +# Docker "inception". +# Note this is quite the ugly hack. +# This makes sure that the docker binary we inject has its dependencies. +RUN curl https://get.docker.com/ | sh +RUN apt-get remove --purge -y docker-engine + +RUN mkdir /var/local/jenkins + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh index 148a0f5e08..26e5585d2d 100755 --- a/tools/jenkins/docker_run_tests.sh +++ b/tools/jenkins/docker_run_tests.sh @@ -1,5 +1,5 @@ #!/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 @@ -43,8 +43,12 @@ 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 -rvm use ruby-2.1 +nvm use 0.12 || true + +if [ -x "$(command -v rvm)" ] +then + rvm use ruby-2.1 +fi mkdir -p reports diff --git a/tools/run_tests/check_cache_mk.sh b/tools/run_tests/check_cache_mk.sh deleted file mode 100755 index b738d6a965..0000000000 --- a/tools/run_tests/check_cache_mk.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# 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 -e - -if [ -f cache.mk ] ; then - echo "Please don't commit cache.mk" - exit 1 -fi - diff --git a/tools/run_tests/check_sources_and_headers.py b/tools/run_tests/check_sources_and_headers.py deleted file mode 100755 index 50574f44b0..0000000000 --- a/tools/run_tests/check_sources_and_headers.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python2.7 -# 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. - -import json -import os -import re -import sys - -root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) -with open(os.path.join(root, 'tools', 'run_tests', 'sources_and_headers.json')) as f: - js = json.loads(f.read()) - -re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"') -assert re_inc1.match('#include "foo"').group(1) == 'foo' -re_inc2 = re.compile(r'^#\s*include\s*<((grpc|grpc\+\+)/[^"]*)>') -assert re_inc2.match('#include ').group(1) == 'grpc++/foo' - -def get_target(name): - for target in js: - if target['name'] == name: - return target - assert False, 'no target %s' % name - -def target_has_header(target, name): -# print target['name'], name - if name in target['headers']: - return True - for dep in target['deps']: - if target_has_header(get_target(dep), name): - return True - if name == 'src/core/profiling/stap_probes.h': - return True - return False - -errors = 0 -for target in js: - for fn in target['src']: - with open(os.path.join(root, fn)) as f: - src = f.read().splitlines() - for line in src: - m = re_inc1.match(line) - if m: - if not target_has_header(target, m.group(1)): - print ( - 'target %s (%s) does not name header %s as a dependency' % ( - target['name'], fn, m.group(1))) - errors += 1 - m = re_inc2.match(line) - if m: - if not target_has_header(target, 'include/' + m.group(1)): - print ( - 'target %s (%s) does not name header %s as a dependency' % ( - target['name'], fn, m.group(1))) - errors += 1 - -assert errors == 0 diff --git a/tools/run_tests/check_submodules.sh b/tools/run_tests/check_submodules.sh deleted file mode 100755 index b4ca4fa3ce..0000000000 --- a/tools/run_tests/check_submodules.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# 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 -e - -export TEST=true - -cd `dirname $0`/../.. - -submodules=`mktemp /tmp/submXXXXXX` -want_submodules=`mktemp /tmp/submXXXXXX` - -git submodule | awk '{ print $1 }' | sort > $submodules -cat << EOF | awk '{ print $1 }' | sort > $want_submodules - 9f897b25800d2f54f5c442ef01a60721aeca6d87 third_party/boringssl (version_for_cocoapods_1.0-67-g9f897b2) - 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) - c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) - d5fb408ddc281ffcadeb08699e65bb694656d0bd third_party/protobuf (v3.0.0-beta-2) - 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) -EOF - -diff -u $submodules $want_submodules - -rm $submodules $want_submodules - diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 488af3b4da..d3e17c5100 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -183,6 +183,9 @@ class CLanguage(object): def supports_multi_config(self): return True + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return self.make_target @@ -215,6 +218,9 @@ class NodeLanguage(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return 'node' @@ -246,6 +252,9 @@ class PhpLanguage(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return 'php' @@ -299,6 +308,9 @@ class PythonLanguage(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return 'python' @@ -330,6 +342,9 @@ class RubyLanguage(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return 'ruby' @@ -412,6 +427,9 @@ class CSharpLanguage(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return 'csharp' @@ -443,6 +461,9 @@ class ObjCLanguage(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return 'objc' @@ -451,8 +472,10 @@ class Sanity(object): def test_specs(self, config, args): import yaml - with open('tools/run_tests/sanity_tests.yaml', 'r') as f: - return [config.job_spec(cmd['script'].split(), None, timeout_seconds=None, environ={'TEST': 'true'}, cpu_cost=cmd.get('cpu_cost', 1)) + with open('tools/run_tests/sanity/sanity_tests.yaml', 'r') as f: + return [config.job_spec(cmd['script'].split(), None, + timeout_seconds=None, environ={'TEST': 'true'}, + cpu_cost=cmd.get('cpu_cost', 1)) for cmd in yaml.load(f)] def pre_build_steps(self): @@ -476,6 +499,9 @@ class Sanity(object): def supports_multi_config(self): return False + def dockerfile_dir(self, config, arch): + return 'tools/dockerfile/grpc_sanity' + def __str__(self): return 'sanity' @@ -506,6 +532,9 @@ class Build(object): def supports_multi_config(self): return True + def dockerfile_dir(self, config, arch): + return None + def __str__(self): return self.make_target @@ -545,7 +574,7 @@ def _windows_arch_option(arch): else: print 'Architecture %s not supported.' % arch sys.exit(1) - + def _check_arch_option(arch): """Checks that architecture option is valid.""" @@ -595,15 +624,19 @@ def _windows_toolset_option(compiler): sys.exit(1) -def _get_dockerfile_dir(arch): +def _get_dockerfile_dir(language, cfg, arch): """Returns dockerfile to use""" - if arch == 'default' or arch == 'x64': - return 'tools/dockerfile/grpc_jenkins_slave_x64' - elif arch == 'x86': - return 'tools/dockerfile/grpc_jenkins_slave_x86' + custom = language.dockerfile_dir(cfg, arch) + if custom: + return custom else: - print 'Architecture %s not supported with current settings.' % arch - sys.exit(1) + if arch == 'default' or arch == 'x64': + return 'tools/dockerfile/grpc_jenkins_slave_x64' + elif arch == 'x86': + return 'tools/dockerfile/grpc_jenkins_slave_x86' + else: + print 'Architecture %s not supported with current settings.' % arch + sys.exit(1) def runs_per_test_type(arg_str): """Auxilary function to parse the "runs_per_test" flag. @@ -775,7 +808,9 @@ if args.use_docker: env = os.environ.copy() env['RUN_TESTS_COMMAND'] = run_tests_cmd - env['DOCKERFILE_DIR'] = _get_dockerfile_dir(args.arch) + env['DOCKERFILE_DIR'] = _get_dockerfile_dir(next(iter(languages)), + next(iter(build_configs)), + args.arch) env['DOCKER_RUN_SCRIPT'] = 'tools/jenkins/docker_run_tests.sh' if args.xml_report: env['XML_REPORT'] = args.xml_report @@ -786,7 +821,7 @@ if args.use_docker: shell=True, env=env) sys.exit(0) - + if platform_string() != 'windows' and args.compiler != 'default': print 'Compiler %s not supported on current platform.' % args.compiler sys.exit(1) diff --git a/tools/run_tests/sanity/check_cache_mk.sh b/tools/run_tests/sanity/check_cache_mk.sh new file mode 100755 index 0000000000..b738d6a965 --- /dev/null +++ b/tools/run_tests/sanity/check_cache_mk.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# 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 -e + +if [ -f cache.mk ] ; then + echo "Please don't commit cache.mk" + exit 1 +fi + diff --git a/tools/run_tests/sanity/check_sources_and_headers.py b/tools/run_tests/sanity/check_sources_and_headers.py new file mode 100755 index 0000000000..3974af0032 --- /dev/null +++ b/tools/run_tests/sanity/check_sources_and_headers.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python2.7 +# 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. + +import json +import os +import re +import sys + +root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../../..')) +with open(os.path.join(root, 'tools', 'run_tests', 'sources_and_headers.json')) as f: + js = json.loads(f.read()) + +re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"') +assert re_inc1.match('#include "foo"').group(1) == 'foo' +re_inc2 = re.compile(r'^#\s*include\s*<((grpc|grpc\+\+)/[^"]*)>') +assert re_inc2.match('#include ').group(1) == 'grpc++/foo' + +def get_target(name): + for target in js: + if target['name'] == name: + return target + assert False, 'no target %s' % name + +def target_has_header(target, name): + # print target['name'], name + if name in target['headers']: + return True + for dep in target['deps']: + if target_has_header(get_target(dep), name): + return True + if name == 'src/core/profiling/stap_probes.h': + return True + return False + +errors = 0 +for target in js: + for fn in target['src']: + with open(os.path.join(root, fn)) as f: + src = f.read().splitlines() + for line in src: + m = re_inc1.match(line) + if m: + if not target_has_header(target, m.group(1)): + print ( + 'target %s (%s) does not name header %s as a dependency' % ( + target['name'], fn, m.group(1))) + errors += 1 + m = re_inc2.match(line) + if m: + if not target_has_header(target, 'include/' + m.group(1)): + print ( + 'target %s (%s) does not name header %s as a dependency' % ( + target['name'], fn, m.group(1))) + errors += 1 + +assert errors == 0 diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh new file mode 100755 index 0000000000..f49230e49a --- /dev/null +++ b/tools/run_tests/sanity/check_submodules.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +# 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 -e + +export TEST=true + +cd `dirname $0`/../../.. + +submodules=`mktemp /tmp/submXXXXXX` +want_submodules=`mktemp /tmp/submXXXXXX` + +git submodule | awk '{ print $1 }' | sort > $submodules +cat << EOF | awk '{ print $1 }' | sort > $want_submodules + 9f897b25800d2f54f5c442ef01a60721aeca6d87 third_party/boringssl (version_for_cocoapods_1.0-67-g9f897b2) + 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) + c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) + d5fb408ddc281ffcadeb08699e65bb694656d0bd third_party/protobuf (v3.0.0-beta-2) + 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) +EOF + +diff -u $submodules $want_submodules + +rm $submodules $want_submodules + diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml new file mode 100644 index 0000000000..809e6ce645 --- /dev/null +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -0,0 +1,9 @@ +# a set of tests that are run in parallel for sanity tests +- script: tools/run_tests/sanity/check_sources_and_headers.py +- script: tools/run_tests/sanity/check_submodules.sh +- script: tools/run_tests/sanity/check_cache_mk.sh +- script: tools/buildgen/generate_projects.sh -j 3 + cpu_cost: 3 +- script: tools/distrib/check_copyright.py +- script: tools/distrib/clang_format_code.sh +- script: tools/distrib/check_trailing_newlines.sh diff --git a/tools/run_tests/sanity_tests.yaml b/tools/run_tests/sanity_tests.yaml deleted file mode 100644 index 757bcd9d34..0000000000 --- a/tools/run_tests/sanity_tests.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# a set of tests that are run in parallel for sanity tests -- script: tools/run_tests/check_sources_and_headers.py -- script: tools/run_tests/check_submodules.sh -- script: tools/run_tests/check_cache_mk.sh -- script: tools/buildgen/generate_projects.sh -j 3 - cpu_cost: 3 -- script: tools/distrib/check_copyright.py -- script: tools/distrib/clang_format_code.sh -- script: tools/distrib/check_trailing_newlines.sh -- cgit v1.2.3 From 2bb4d3fda259d292b5373bbc71dbe4ffac85895e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 26 Jan 2016 14:29:51 -0800 Subject: dockerfile cleanup --- tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile | 13 +------------ tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile | 6 +----- tools/dockerfile/grpc_sanity/Dockerfile | 15 +-------------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile b/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile index ad11733b7d..7785f3d99a 100644 --- a/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile +++ b/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile @@ -27,8 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# A work-in-progress Dockerfile that allows running gRPC test suites -# inside a docker container. +# Dockerfile for running gRPC test suites inside a docker container. FROM debian:jessie @@ -152,18 +151,8 @@ RUN apt-get update && apt-get install -y \ ################## # Zookeeper dependencies - -# Install dependencies - RUN apt-get install -y libzookeeper-mt-dev -################## -# Docker "inception". -# Note this is quite the ugly hack. -# This makes sure that the docker binary we inject has its dependencies. -RUN curl https://get.docker.com/ | sh -RUN apt-get remove --purge -y docker-engine - RUN mkdir /var/local/jenkins # Define the default command. diff --git a/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile b/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile index 067c209db7..c5cd45ea08 100644 --- a/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile +++ b/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile @@ -27,8 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# A work-in-progress Dockerfile that allows running gRPC test suites -# inside a docker container. +# Dockerfile for running gRPC test suites inside a docker container. FROM 32bit/debian:jessie @@ -151,9 +150,6 @@ RUN apt-get update && apt-get install -y \ ################## # Zookeeper dependencies - -# Install dependencies - RUN apt-get install -y libzookeeper-mt-dev diff --git a/tools/dockerfile/grpc_sanity/Dockerfile b/tools/dockerfile/grpc_sanity/Dockerfile index 87b3a7a81f..6f7797d32a 100644 --- a/tools/dockerfile/grpc_sanity/Dockerfile +++ b/tools/dockerfile/grpc_sanity/Dockerfile @@ -27,8 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# A work-in-progress Dockerfile that allows running gRPC test suites -# inside a docker container. +# Dockerfile for running gRPC sanity tests FROM debian:jessie @@ -62,18 +61,6 @@ RUN apt-get update && apt-get install -y \ wget \ zip && apt-get clean -# Prepare ccache -RUN ln -s /usr/bin/ccache /usr/local/bin/gcc -RUN ln -s /usr/bin/ccache /usr/local/bin/g++ -RUN ln -s /usr/bin/ccache /usr/local/bin/cc -RUN ln -s /usr/bin/ccache /usr/local/bin/c++ -RUN ln -s /usr/bin/ccache /usr/local/bin/clang -RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ - -################## -# C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang - ################## # Sanity test dependencies RUN apt-get update && apt-get install -y python-pip -- cgit v1.2.3 From ed342b1c4d9abe15dd9f8f29f38bb3b46fd143c8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 26 Jan 2016 14:40:31 -0800 Subject: meaningful name for grpc_jenkins_slave --- tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile | 159 --------------------- tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile | 159 --------------------- .../dockerfile/grpc_tests_multilang_x64/Dockerfile | 159 +++++++++++++++++++++ .../dockerfile/grpc_tests_multilang_x86/Dockerfile | 159 +++++++++++++++++++++ tools/run_tests/run_tests.py | 6 +- 5 files changed, 321 insertions(+), 321 deletions(-) delete mode 100644 tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile delete mode 100644 tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile create mode 100644 tools/dockerfile/grpc_tests_multilang_x64/Dockerfile create mode 100644 tools/dockerfile/grpc_tests_multilang_x86/Dockerfile diff --git a/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile b/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile deleted file mode 100644 index 7785f3d99a..0000000000 --- a/tools/dockerfile/grpc_jenkins_slave_x64/Dockerfile +++ /dev/null @@ -1,159 +0,0 @@ -# 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. - -# Dockerfile for running gRPC test suites inside a docker container. - -FROM debian:jessie - -# Install Git and basic packages. -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - perl \ - strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ - unzip \ - wget \ - zip && apt-get clean - -# Prepare ccache -RUN ln -s /usr/bin/ccache /usr/local/bin/gcc -RUN ln -s /usr/bin/ccache /usr/local/bin/g++ -RUN ln -s /usr/bin/ccache /usr/local/bin/cc -RUN ln -s /usr/bin/ccache /usr/local/bin/c++ -RUN ln -s /usr/bin/ccache /usr/local/bin/clang -RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ - -################## -# C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang - -################# -# C# dependencies - -# Update to a newer version of mono -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list - -# Install dependencies -RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ - mono-devel \ - nunit \ - nunit-console \ - monodevelop - -# Download NuGet -RUN cd /var/local && wget www.nuget.org/NuGet.exe -ENV NUGET mono /var/local/NuGet.exe - -################## -# Node dependencies - -# Install nvm -RUN touch .profile -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash -RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache" - -################## -# Ruby dependencies - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -RUN \curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby 2.1 -RUN /bin/bash -l -c "rvm install ruby-2.1" -RUN /bin/bash -l -c "rvm use --default ruby-2.1" -RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" -RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" - -################## -# Python dependencies - -# Install dependencies - -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-pip - -# Install Python packages from PyPI -RUN pip install pip --upgrade -RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 tox - -# For sanity test -RUN pip install simplejson mako - -################## -# PHP dependencies - -# Install dependencies - -RUN /bin/bash -l -c "echo 'deb http://packages.dotdeb.org wheezy-php55 all' \ - >> /etc/apt/sources.list.d/dotdeb.list" -RUN /bin/bash -l -c "echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' \ - >> /etc/apt/sources.list.d/dotdeb.list" -RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - - -RUN apt-get update && apt-get install -y \ - git php5 php5-dev phpunit unzip - -################## -# Zookeeper dependencies -RUN apt-get install -y libzookeeper-mt-dev - -RUN mkdir /var/local/jenkins - -# Define the default command. -CMD ["bash"] diff --git a/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile b/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile deleted file mode 100644 index c5cd45ea08..0000000000 --- a/tools/dockerfile/grpc_jenkins_slave_x86/Dockerfile +++ /dev/null @@ -1,159 +0,0 @@ -# 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. - -# Dockerfile for running gRPC test suites inside a docker container. - -FROM 32bit/debian:jessie - -# Install Git and basic packages. -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - perl \ - strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ - unzip \ - wget \ - zip && apt-get clean - -# Prepare ccache -RUN ln -s /usr/bin/ccache /usr/local/bin/gcc -RUN ln -s /usr/bin/ccache /usr/local/bin/g++ -RUN ln -s /usr/bin/ccache /usr/local/bin/cc -RUN ln -s /usr/bin/ccache /usr/local/bin/c++ -RUN ln -s /usr/bin/ccache /usr/local/bin/clang -RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ - -################## -# C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang - -################# -# C# dependencies - -# Update to a newer version of mono -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list - -# Install dependencies -RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ - mono-devel \ - nunit \ - nunit-console \ - monodevelop - -# Download NuGet -RUN cd /var/local && wget www.nuget.org/NuGet.exe -ENV NUGET mono /var/local/NuGet.exe - -################## -# Node dependencies - -# Install nvm -RUN touch .profile -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash -RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache" - -################## -# Ruby dependencies - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -RUN \curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby 2.1 -RUN /bin/bash -l -c "rvm install ruby-2.1" -RUN /bin/bash -l -c "rvm use --default ruby-2.1" -RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" -RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" - -################## -# Python dependencies - -# Install dependencies - -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-pip \ - python-virtualenv - -# Install Python packages from PyPI -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 - -# For sanity test -RUN pip install simplejson mako - -################## -# PHP dependencies - -# Install dependencies - -RUN /bin/bash -l -c "echo 'deb http://packages.dotdeb.org wheezy-php55 all' \ - >> /etc/apt/sources.list.d/dotdeb.list" -RUN /bin/bash -l -c "echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' \ - >> /etc/apt/sources.list.d/dotdeb.list" -RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - - -RUN apt-get update && apt-get install -y \ - git php5 php5-dev phpunit unzip - -################## -# Zookeeper dependencies -RUN apt-get install -y libzookeeper-mt-dev - - -RUN mkdir /var/local/jenkins - -# Define the default command. -CMD ["bash"] diff --git a/tools/dockerfile/grpc_tests_multilang_x64/Dockerfile b/tools/dockerfile/grpc_tests_multilang_x64/Dockerfile new file mode 100644 index 0000000000..7785f3d99a --- /dev/null +++ b/tools/dockerfile/grpc_tests_multilang_x64/Dockerfile @@ -0,0 +1,159 @@ +# 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. + +# Dockerfile for running gRPC test suites inside a docker container. + +FROM debian:jessie + +# Install Git and basic packages. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + golang \ + gyp \ + lcov \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + perl \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################## +# C++ dependencies +RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang + +################# +# C# dependencies + +# Update to a newer version of mono +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list + +# Install dependencies +RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ + mono-devel \ + nunit \ + nunit-console \ + monodevelop + +# Download NuGet +RUN cd /var/local && wget www.nuget.org/NuGet.exe +ENV NUGET mono /var/local/NuGet.exe + +################## +# Node dependencies + +# Install nvm +RUN touch .profile +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash +RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache" + +################## +# Ruby dependencies + +# Install rvm +RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +RUN \curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby 2.1 +RUN /bin/bash -l -c "rvm install ruby-2.1" +RUN /bin/bash -l -c "rvm use --default ruby-2.1" +RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" +RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" +RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" +RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" + +################## +# Python dependencies + +# Install dependencies + +RUN apt-get update && apt-get install -y \ + python-all-dev \ + python3-all-dev \ + python-pip + +# Install Python packages from PyPI +RUN pip install pip --upgrade +RUN pip install virtualenv +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 tox + +# For sanity test +RUN pip install simplejson mako + +################## +# PHP dependencies + +# Install dependencies + +RUN /bin/bash -l -c "echo 'deb http://packages.dotdeb.org wheezy-php55 all' \ + >> /etc/apt/sources.list.d/dotdeb.list" +RUN /bin/bash -l -c "echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' \ + >> /etc/apt/sources.list.d/dotdeb.list" +RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - + +RUN apt-get update && apt-get install -y \ + git php5 php5-dev phpunit unzip + +################## +# Zookeeper dependencies +RUN apt-get install -y libzookeeper-mt-dev + +RUN mkdir /var/local/jenkins + +# Define the default command. +CMD ["bash"] diff --git a/tools/dockerfile/grpc_tests_multilang_x86/Dockerfile b/tools/dockerfile/grpc_tests_multilang_x86/Dockerfile new file mode 100644 index 0000000000..c5cd45ea08 --- /dev/null +++ b/tools/dockerfile/grpc_tests_multilang_x86/Dockerfile @@ -0,0 +1,159 @@ +# 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. + +# Dockerfile for running gRPC test suites inside a docker container. + +FROM 32bit/debian:jessie + +# Install Git and basic packages. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + golang \ + gyp \ + lcov \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + perl \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################## +# C++ dependencies +RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang + +################# +# C# dependencies + +# Update to a newer version of mono +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list + +# Install dependencies +RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ + mono-devel \ + nunit \ + nunit-console \ + monodevelop + +# Download NuGet +RUN cd /var/local && wget www.nuget.org/NuGet.exe +ENV NUGET mono /var/local/NuGet.exe + +################## +# Node dependencies + +# Install nvm +RUN touch .profile +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash +RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache" + +################## +# Ruby dependencies + +# Install rvm +RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +RUN \curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby 2.1 +RUN /bin/bash -l -c "rvm install ruby-2.1" +RUN /bin/bash -l -c "rvm use --default ruby-2.1" +RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" +RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" +RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" +RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" + +################## +# Python dependencies + +# Install dependencies + +RUN apt-get update && apt-get install -y \ + python-all-dev \ + python3-all-dev \ + python-pip \ + python-virtualenv + +# Install Python packages from PyPI +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 + +# For sanity test +RUN pip install simplejson mako + +################## +# PHP dependencies + +# Install dependencies + +RUN /bin/bash -l -c "echo 'deb http://packages.dotdeb.org wheezy-php55 all' \ + >> /etc/apt/sources.list.d/dotdeb.list" +RUN /bin/bash -l -c "echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' \ + >> /etc/apt/sources.list.d/dotdeb.list" +RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - + +RUN apt-get update && apt-get install -y \ + git php5 php5-dev phpunit unzip + +################## +# Zookeeper dependencies +RUN apt-get install -y libzookeeper-mt-dev + + +RUN mkdir /var/local/jenkins + +# Define the default command. +CMD ["bash"] diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index d3e17c5100..885a79c07b 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -631,9 +631,9 @@ def _get_dockerfile_dir(language, cfg, arch): return custom else: if arch == 'default' or arch == 'x64': - return 'tools/dockerfile/grpc_jenkins_slave_x64' + return 'tools/dockerfile/grpc_tests_multilang_x64' elif arch == 'x86': - return 'tools/dockerfile/grpc_jenkins_slave_x86' + return 'tools/dockerfile/grpc_tests_multilang_x86' else: print 'Architecture %s not supported with current settings.' % arch sys.exit(1) @@ -804,7 +804,7 @@ if args.use_docker: time.sleep(5) child_argv = [ arg for arg in sys.argv if not arg == '--use_docker' ] - run_tests_cmd = 'tools/run_tests/run_tests.py %s' % ' '.join(child_argv[1:]) + run_tests_cmd = 'python tools/run_tests/run_tests.py %s' % ' '.join(child_argv[1:]) env = os.environ.copy() env['RUN_TESTS_COMMAND'] = run_tests_cmd -- cgit v1.2.3