diff options
Diffstat (limited to 'tools/run_tests')
-rw-r--r--[-rwxr-xr-x] | tools/run_tests/artifact_targets.py (renamed from tools/run_tests/build_artifacts.py) | 123 | ||||
-rwxr-xr-x | tools/run_tests/build_node.sh | 4 | ||||
-rw-r--r-- | tools/run_tests/configs.json | 2 | ||||
-rw-r--r-- | tools/run_tests/distribtest_targets.py | 88 | ||||
-rwxr-xr-x | tools/run_tests/jobset.py | 2 | ||||
-rw-r--r-- | tools/run_tests/package_targets.py | 73 | ||||
-rwxr-xr-x | tools/run_tests/run_node.sh | 4 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 177 | ||||
-rwxr-xr-x | tools/run_tests/sanity/check_cache_mk.sh (renamed from tools/run_tests/check_cache_mk.sh) | 0 | ||||
-rwxr-xr-x | tools/run_tests/sanity/check_sources_and_headers.py (renamed from tools/run_tests/check_sources_and_headers.py) | 66 | ||||
-rwxr-xr-x | tools/run_tests/sanity/check_submodules.sh (renamed from tools/run_tests/check_submodules.sh) | 2 | ||||
-rw-r--r-- | tools/run_tests/sanity/sanity_tests.yaml | 9 | ||||
-rw-r--r-- | tools/run_tests/sanity_tests.yaml | 9 | ||||
-rw-r--r-- | tools/run_tests/sources_and_headers.json | 344 | ||||
-rwxr-xr-x | tools/run_tests/task_runner.py | 126 | ||||
-rw-r--r-- | tools/run_tests/tests.json | 139 |
16 files changed, 912 insertions, 256 deletions
diff --git a/tools/run_tests/build_artifacts.py b/tools/run_tests/artifact_targets.py index ff9dd4735a..a34fa8e4fa 100755..100644 --- a/tools/run_tests/build_artifacts.py +++ b/tools/run_tests/artifact_targets.py @@ -28,28 +28,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Builds gRPC distribution artifacts.""" +"""Definition of targets to build artifacts.""" -import argparse -import atexit -import dockerjob -import itertools import jobset -import json -import multiprocessing -import os -import re -import subprocess -import sys -import time -import uuid - -# Docker doesn't clean up after itself, so we do it on exit. -if jobset.platform_string() == 'linux': - atexit.register(lambda: subprocess.call(['stty', 'echo'])) - -ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) -os.chdir(ROOT) def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, @@ -58,7 +39,6 @@ def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, environ = environ.copy() environ['RUN_COMMAND'] = shell_command - #docker_args = ['-v', '%s/artifacts:/var/local/jenkins/grpc/artifacts' % ROOT] docker_args=[] for k,v in environ.iteritems(): docker_args += ['-e', '%s=%s' % (k, v)] @@ -107,7 +87,7 @@ class CSharpExtArtifact: self.name = 'csharp_ext_%s_%s' % (platform, arch) self.platform = platform self.arch = arch - self.labels = ['csharp', platform, arch] + self.labels = ['artifact', 'csharp', platform, arch] def pre_build_jobspecs(self): if self.platform == 'windows': @@ -135,7 +115,7 @@ class CSharpExtArtifact: 'EMBED_ZLIB': 'true'} if self.platform == 'linux': return create_docker_jobspec(self.name, - 'tools/jenkins/grpc_artifact_linux_%s' % self.arch, + 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, 'tools/run_tests/build_artifact_csharp.sh') else: environ.update(macos_arch_env(self.arch)) @@ -147,92 +127,11 @@ class CSharpExtArtifact: return self.name -_ARTIFACTS = [ - CSharpExtArtifact('linux', 'x86'), - CSharpExtArtifact('linux', 'x64'), - CSharpExtArtifact('macos', 'x86'), - CSharpExtArtifact('macos', 'x64'), - CSharpExtArtifact('windows', 'x86'), - CSharpExtArtifact('windows', 'x64') -] - - -def _create_build_map(): - """Maps artifact names and labels to list of artifacts to be built.""" - artifact_build_map = dict([(artifact.name, [artifact]) - for artifact in _ARTIFACTS]) - if len(_ARTIFACTS) > len(artifact_build_map.keys()): - raise Exception('Artifact names need to be unique') - - label_build_map = {} - label_build_map['all'] = [a for a in _ARTIFACTS] # to build all artifacts - for artifact in _ARTIFACTS: - for label in artifact.labels: - if label in label_build_map: - label_build_map[label].append(artifact) - else: - label_build_map[label] = [artifact] - - if set(artifact_build_map.keys()).intersection(label_build_map.keys()): - raise Exception('Artifact names need to be distinct from label names') - return dict( artifact_build_map.items() + label_build_map.items()) - - -_BUILD_MAP = _create_build_map() - -argp = argparse.ArgumentParser(description='Builds distribution artifacts.') -argp.add_argument('-b', '--build', - choices=sorted(_BUILD_MAP.keys()), - nargs='+', - default=['all'], - help='Artifact name or artifact label to build.') -argp.add_argument('-f', '--filter', - choices=sorted(_BUILD_MAP.keys()), - nargs='+', - default=[], - help='Filter artifacts to build with AND semantics.') -argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int) -argp.add_argument('-t', '--travis', - default=False, - action='store_const', - const=True) - -args = argp.parse_args() - -# Figure out which artifacts to build -artifacts = [] -for label in args.build: - artifacts += _BUILD_MAP[label] - -# Among target selected by -b, filter out those that don't match the filter -artifacts = [a for a in artifacts if all(f in a.labels for f in args.filter)] -artifacts = sorted(set(artifacts)) - -# Execute pre-build phase -prebuild_jobs = [] -for artifact in artifacts: - prebuild_jobs += artifact.pre_build_jobspecs() -if prebuild_jobs: - num_failures, _ = jobset.run( - prebuild_jobs, newline_on_success=True, maxjobs=args.jobs) - if num_failures != 0: - jobset.message('FAILED', 'Pre-build phase failed.', do_newline=True) - sys.exit(1) - -build_jobs = [] -for artifact in artifacts: - build_jobs.append(artifact.build_jobspec()) -if not build_jobs: - print 'Nothing to build.' - sys.exit(1) - -jobset.message('START', 'Building artifacts.', do_newline=True) -num_failures, _ = jobset.run( - build_jobs, newline_on_success=True, maxjobs=args.jobs) -if num_failures == 0: - jobset.message('SUCCESS', 'All artifacts built successfully.', - do_newline=True) -else: - jobset.message('FAILED', 'Failed to build artifacts.', - do_newline=True) - sys.exit(1) +def targets(): + """Gets list of supported targets""" + return [CSharpExtArtifact('linux', 'x86'), + CSharpExtArtifact('linux', 'x64'), + CSharpExtArtifact('macos', 'x86'), + CSharpExtArtifact('macos', 'x64'), + CSharpExtArtifact('windows', 'x86'), + CSharpExtArtifact('windows', 'x64')] diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/build_node.sh index faa7b624b8..8f2ab4413a 100755 --- a/tools/run_tests/build_node.sh +++ b/tools/run_tests/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 @@ -36,4 +36,4 @@ CONFIG=${CONFIG:-opt} # change to grpc repo root cd $(dirname $0)/../.. -npm install --unsafe-perm +npm install --unsafe-perm --build-from-source diff --git a/tools/run_tests/configs.json b/tools/run_tests/configs.json index 769942df99..d508c6394c 100644 --- a/tools/run_tests/configs.json +++ b/tools/run_tests/configs.json @@ -59,7 +59,7 @@ }, { "config": "msan", - "timeout_multiplier": 1.5 + "timeout_multiplier": 2 }, { "config": "mutrace" diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py new file mode 100644 index 0000000000..aa1d55aedd --- /dev/null +++ b/tools/run_tests/distribtest_targets.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# 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. + +"""Definition of targets run distribution package tests.""" + +import jobset + + +def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, + flake_retries=0, timeout_retries=0): + """Creates jobspec for a task running under docker.""" + environ = environ.copy() + environ['RUN_COMMAND'] = shell_command + + docker_args=[] + for k,v in environ.iteritems(): + docker_args += ['-e', '%s=%s' % (k, v)] + docker_env = {'DOCKERFILE_DIR': dockerfile_dir, + 'DOCKER_RUN_SCRIPT': 'tools/jenkins/docker_run.sh'} + jobspec = jobset.JobSpec( + cmdline=['tools/jenkins/build_and_run_docker.sh'] + docker_args, + environ=docker_env, + shortname='distribtest.%s' % (name), + timeout_seconds=30*60, + flake_retries=flake_retries, + timeout_retries=timeout_retries) + return jobspec + + +class CSharpDistribTest: + """Tests C# NuGet package""" + + def __init__(self, platform, arch, docker_suffix): + self.name = 'csharp_nuget_%s_%s_%s' % (platform, arch, docker_suffix) + self.platform = platform + self.arch = arch + self.docker_suffix = docker_suffix + self.labels = ['distribtest', 'csharp', platform, arch] + + 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, + 'tools/dockerfile/distribtest/csharp_%s_%s' % ( + self.docker_suffix, + self.arch), + 'test/distrib/csharp/run_distrib_test.sh') + + def __str__(self): + return self.name + + +def targets(): + """Gets list of supported targets""" + return [CSharpDistribTest('linux', 'x64', 'wheezy'), + CSharpDistribTest('linux', 'x64', 'jessie'), + CSharpDistribTest('linux', 'x86', 'jessie')] diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index beeb99c0ae..adf178bb3c 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -360,7 +360,7 @@ class Jobset(object): if self.cancelled(): return False current_cpu_cost = self.cpu_cost() if current_cpu_cost == 0: break - if current_cpu_cost + spec.cpu_cost < self._maxjobs: break + if current_cpu_cost + spec.cpu_cost <= self._maxjobs: break self.reap() if self.cancelled(): return False if spec.hash_targets: diff --git a/tools/run_tests/package_targets.py b/tools/run_tests/package_targets.py new file mode 100644 index 0000000000..839991e270 --- /dev/null +++ b/tools/run_tests/package_targets.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# 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. + +"""Definition of targets to build distribution packages.""" + +import jobset + + +def create_jobspec(name, cmdline, environ=None, cwd=None, shell=False, + flake_retries=0, timeout_retries=0): + """Creates jobspec.""" + jobspec = jobset.JobSpec( + cmdline=cmdline, + environ=environ, + cwd=cwd, + shortname='build_package.%s' % (name), + timeout_seconds=10*60, + flake_retries=flake_retries, + timeout_retries=timeout_retries, + shell=shell) + return jobspec + + +class CSharpNugetTarget: + """Builds C# nuget packages.""" + + def __init__(self): + self.name = 'csharp_nuget' + self.labels = ['package', 'csharp', 'windows'] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + return create_jobspec(self.name, + ['build_packages.bat'], + cwd='src\\csharp', + shell=True) + + def __str__(self): + return self.name + + +def targets(): + """Gets list of supported targets""" + return [CSharpNugetTarget()] diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index fff579fab8..f93c9c30cb 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.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 @@ -51,5 +51,5 @@ then echo '<html><head><meta http-equiv="refresh" content="0;URL=lcov-report/index.html"></head></html>' > \ ../reports/node_coverage/index.html else - JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 ./node_modules/.bin/mocha --reporter mocha-jenkins-reporter src/node/test || true + JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 ./node_modules/.bin/mocha --reporter mocha-jenkins-reporter src/node/test fi diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index f8b01021c8..9e7b97c6a2 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -132,8 +132,10 @@ class CLanguage(object): if config.build_config in target['exclude_configs']: continue if self.platform == 'windows': - binary = 'vsprojects/%s/%s.exe' % ( - _WINDOWS_CONFIG[config.build_config], target['name']) + binary = 'vsprojects/%s%s/%s.exe' % ( + 'x64/' if args.arch == 'x64' else '', + _WINDOWS_CONFIG[config.build_config], + target['name']) else: binary = 'bins/%s/%s' % (config.build_config, target['name']) if os.path.isfile(binary): @@ -151,9 +153,9 @@ class CLanguage(object): def make_targets(self, test_regex): if platform_string() != 'windows' and test_regex != '.*': # use the regex to minimize the number of things to build - return [target['name'] + return [os.path.basename(target['name']) for target in get_c_tests(False, self.test_lang) - if re.search(test_regex, target['name'])] + if re.search(test_regex, '/' + target['name'])] if platform_string() == 'windows': # don't build tools on windows just yet return ['buildtests_%s' % self.make_target] @@ -183,6 +185,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 +220,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 +254,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 +310,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 +344,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 +429,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 +463,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 +474,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']], 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 +501,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 +534,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 @@ -538,15 +569,37 @@ _WINDOWS_CONFIG = { def _windows_arch_option(arch): """Returns msbuild cmdline option for selected architecture.""" - if arch == 'default' or arch == 'windows_x86': + if arch == 'default' or arch == 'x86': return '/p:Platform=Win32' - elif arch == 'windows_x64': + elif arch == 'x64': return '/p:Platform=x64' else: - print 'Architecture %s not supported on current platform.' % arch + print 'Architecture %s not supported.' % arch sys.exit(1) - + +def _check_arch_option(arch): + """Checks that architecture option is valid.""" + if platform_string() == 'windows': + _windows_arch_option(arch) + elif platform_string() == 'linux': + # On linux, we need to be running under docker with the right architecture. + runtime_arch = platform.architecture()[0] + if arch == 'default': + return + elif runtime_arch == '64bit' and arch == 'x64': + return + elif runtime_arch == '32bit' and arch == 'x86': + return + else: + print 'Architecture %s does not match current runtime architecture.' % arch + sys.exit(1) + else: + if args.arch != 'default': + print 'Architecture %s not supported on current platform.' % args.arch + sys.exit(1) + + def _windows_build_bat(compiler): """Returns name of build.bat for selected compiler.""" if compiler == 'default' or compiler == 'vs2013': @@ -558,8 +611,8 @@ def _windows_build_bat(compiler): else: print 'Compiler %s not supported.' % compiler sys.exit(1) - - + + def _windows_toolset_option(compiler): """Returns msbuild PlatformToolset for selected compiler.""" if compiler == 'default' or compiler == 'vs2013': @@ -571,7 +624,21 @@ def _windows_toolset_option(compiler): else: print 'Compiler %s not supported.' % compiler sys.exit(1) - + + +def _get_dockerfile_dir(language, cfg, arch): + """Returns dockerfile to use""" + custom = language.dockerfile_dir(cfg, arch) + if custom: + return custom + else: + if arch == 'default' or arch == 'x64': + return 'tools/dockerfile/grpc_tests_multilang_x64' + elif arch == 'x86': + return 'tools/dockerfile/grpc_tests_multilang_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. @@ -638,7 +705,7 @@ argp.add_argument('--allow_flakes', const=True, help='Allow flaky tests to show as passing (re-runs failed tests up to five times)') argp.add_argument('--arch', - choices=['default', 'windows_x86', 'windows_x64'], + choices=['default', 'x86', 'x64'], default='default', help='Selects architecture to target. For some platforms "default" is the only supported choice.') argp.add_argument('--compiler', @@ -662,36 +729,6 @@ args = argp.parse_args() jobset.measure_cpu_costs = args.measure_cpu_costs -if args.use_docker: - if not args.travis: - print 'Seen --use_docker flag, will run tests under docker.' - print - print 'IMPORTANT: The changes you are testing need to be locally committed' - print 'because only the committed changes in the current branch will be' - print 'copied to the docker environment.' - 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:]) - - # TODO(jtattermusch): revisit if we need special handling for arch here - # set arch command prefix in case we are working with different arch. - arch_env = os.getenv('arch') - if arch_env: - run_test_cmd = 'arch %s %s' % (arch_env, run_test_cmd) - - env = os.environ.copy() - env['RUN_TESTS_COMMAND'] = run_tests_cmd - if args.xml_report: - env['XML_REPORT'] = args.xml_report - if not args.travis: - env['TTY_FLAG'] = '-t' # enables Ctrl-C when not on Jenkins. - - subprocess.check_call(['tools/jenkins/build_docker_and_run_tests.sh'], - shell=True, - env=env) - sys.exit(0) - # update submodules if necessary need_to_regenerate_projects = False for spec in args.update_submodules: @@ -755,16 +792,46 @@ if any(language.make_options() for language in languages): else: language_make_options = next(iter(languages)).make_options() -if platform_string() != 'windows': - if args.arch != 'default': - print 'Architecture %s not supported on current platform.' % args.arch - sys.exit(1) - if args.compiler != 'default': +if len(languages) != 1 or len(build_configs) != 1: + print 'Multi-language and multi-config testing is not supported.' + sys.exit(1) + +if args.use_docker: + if not args.travis: + print 'Seen --use_docker flag, will run tests under docker.' + print + print 'IMPORTANT: The changes you are testing need to be locally committed' + print 'because only the committed changes in the current branch will be' + print 'copied to the docker environment.' + time.sleep(5) + + child_argv = [ arg for arg in sys.argv if not arg == '--use_docker' ] + 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 + 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 + if not args.travis: + env['TTY_FLAG'] = '-t' # enables Ctrl-C when not on Jenkins. + + subprocess.check_call(['tools/jenkins/build_docker_and_run_tests.sh'], + 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) -if platform_string() == 'windows': - def make_jobspec(cfg, targets, makefile='Makefile'): +_check_arch_option(args.arch) + +def make_jobspec(cfg, targets, makefile='Makefile'): + if platform_string() == 'windows': extra_args = [] # better do parallel compilation # empirically /m:2 gives the best performance/price and should prevent @@ -782,8 +849,7 @@ if platform_string() == 'windows': language_make_options, shell=True, timeout_seconds=None) for target in targets] -else: - def make_jobspec(cfg, targets, makefile='Makefile'): + else: if targets: return [jobset.JobSpec([os.getenv('MAKE', 'make'), '-f', makefile, @@ -796,6 +862,7 @@ else: timeout_seconds=None)] else: return [] + make_targets = {} for l in languages: makefile = l.makefile_name() @@ -994,13 +1061,15 @@ def _build_and_run( check_cancelled, newline_on_success, cache, xml_report=None, build_only=False): """Do one pass of building & running tests.""" # build latest sequentially - num_failures, _ = jobset.run( + num_failures, resultset = jobset.run( build_steps, maxjobs=1, stop_on_failure=True, newline_on_success=newline_on_success, travis=args.travis) if num_failures: return [BuildAndRunError.BUILD] if build_only: + if xml_report: + report_utils.render_junit_xml_report(resultset, xml_report) return [] # start antagonists diff --git a/tools/run_tests/check_cache_mk.sh b/tools/run_tests/sanity/check_cache_mk.sh index b738d6a965..b738d6a965 100755 --- a/tools/run_tests/check_cache_mk.sh +++ b/tools/run_tests/sanity/check_cache_mk.sh diff --git a/tools/run_tests/check_sources_and_headers.py b/tools/run_tests/sanity/check_sources_and_headers.py index 50574f44b0..3974af0032 100755 --- a/tools/run_tests/check_sources_and_headers.py +++ b/tools/run_tests/sanity/check_sources_and_headers.py @@ -33,9 +33,9 @@ import os import re import sys -root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) +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()) + js = json.loads(f.read()) re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"') assert re_inc1.match('#include "foo"').group(1) == 'foo' @@ -43,41 +43,41 @@ re_inc2 = re.compile(r'^#\s*include\s*<((grpc|grpc\+\+)/[^"]*)>') assert re_inc2.match('#include <grpc++/foo>').group(1) == 'grpc++/foo' def get_target(name): - for target in js: - if target['name'] == name: - return target - assert False, 'no target %s' % 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 + # 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 + 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/sanity/check_submodules.sh index b4ca4fa3ce..f49230e49a 100755 --- a/tools/run_tests/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -34,7 +34,7 @@ set -e export TEST=true -cd `dirname $0`/../.. +cd `dirname $0`/../../.. submodules=`mktemp /tmp/submXXXXXX` want_submodules=`mktemp /tmp/submXXXXXX` 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 160acde565..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 - cpu_cost: 100 -- 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/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index a311a04af3..04035276db 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -10,6 +10,20 @@ ], "headers": [], "language": "c", + "name": "alarm_test", + "src": [ + "test/core/surface/alarm_test.c" + ] + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", "name": "algorithm_test", "src": [ "test/core/compression/algorithm_test.c" @@ -64,6 +78,20 @@ ], "headers": [], "language": "c", + "name": "census_context_test", + "src": [ + "test/core/census/context_test.c" + ] + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", "name": "channel_create_test", "src": [ "test/core/surface/channel_create_test.c" @@ -1098,20 +1126,6 @@ ], "headers": [], "language": "c", - "name": "tag_set_test", - "src": [ - "test/core/census/tag_set_test.c" - ] - }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" - ], - "headers": [], - "language": "c", "name": "tcp_client_posix_test", "src": [ "test/core/iomgr/tcp_client_posix_test.c" @@ -1622,6 +1636,22 @@ "gpr_test_util", "grpc", "grpc++", + "grpc++_test_util", + "grpc_test_util" + ], + "headers": [], + "language": "c++", + "name": "hybrid_end2end_test", + "src": [ + "test/cpp/end2end/hybrid_end2end_test.cc" + ] + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", "grpc++_test_config", "grpc++_test_util", "grpc_test_util", @@ -2738,6 +2768,26 @@ { "deps": [], "headers": [ + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", "include/grpc/support/alloc.h", "include/grpc/support/atm.h", "include/grpc/support/atm_gcc_atomic.h", @@ -2780,6 +2830,26 @@ "language": "c", "name": "gpr", "src": [ + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", "include/grpc/support/alloc.h", "include/grpc/support/atm.h", "include/grpc/support/atm_gcc_atomic.h", @@ -2846,6 +2916,7 @@ "src/core/support/string_win32.c", "src/core/support/string_win32.h", "src/core/support/subprocess_posix.c", + "src/core/support/subprocess_windows.c", "src/core/support/sync.c", "src/core/support/sync_posix.c", "src/core/support/sync_win32.c", @@ -2888,7 +2959,6 @@ "include/grpc/grpc_security.h", "include/grpc/status.h", "src/core/census/aggregation.h", - "src/core/census/context.h", "src/core/census/grpc_filter.h", "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", @@ -3030,14 +3100,13 @@ "include/grpc/status.h", "src/core/census/aggregation.h", "src/core/census/context.c", - "src/core/census/context.h", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", "src/core/census/operation.c", + "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", - "src/core/census/tag_set.c", "src/core/census/tracing.c", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", @@ -3215,6 +3284,7 @@ "src/core/security/server_secure_chttp2.c", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/alarm.c", "src/core/surface/api_trace.c", "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", @@ -3402,7 +3472,6 @@ "include/grpc/grpc.h", "include/grpc/status.h", "src/core/census/aggregation.h", - "src/core/census/context.h", "src/core/census/grpc_filter.h", "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", @@ -3529,14 +3598,13 @@ "include/grpc/status.h", "src/core/census/aggregation.h", "src/core/census/context.c", - "src/core/census/context.h", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", "src/core/census/operation.c", + "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", - "src/core/census/tag_set.c", "src/core/census/tracing.c", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", @@ -3689,6 +3757,7 @@ "src/core/json/json_writer.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/alarm.c", "src/core/surface/api_trace.c", "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", @@ -3844,7 +3913,38 @@ "include/grpc++/grpc++.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", @@ -3898,7 +3998,38 @@ "include/grpc++/grpc++.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", @@ -3941,6 +4072,7 @@ "src/cpp/client/insecure_credentials.cc", "src/cpp/client/secure_credentials.cc", "src/cpp/client/secure_credentials.h", + "src/cpp/codegen/grpc_library.cc", "src/cpp/common/auth_property_iterator.cc", "src/cpp/common/call.cc", "src/cpp/common/channel_arguments.cc", @@ -3997,6 +4129,8 @@ "src/proto/grpc/testing/echo.pb.h", "src/proto/grpc/testing/echo_messages.grpc.pb.h", "src/proto/grpc/testing/echo_messages.pb.h", + "test/cpp/end2end/test_service_impl.h", + "test/cpp/util/byte_buffer_proto_helper.h", "test/cpp/util/cli_call.h", "test/cpp/util/create_test_channel.h", "test/cpp/util/string_ref_helper.h", @@ -4005,6 +4139,10 @@ "language": "c++", "name": "grpc++_test_util", "src": [ + "test/cpp/end2end/test_service_impl.cc", + "test/cpp/end2end/test_service_impl.h", + "test/cpp/util/byte_buffer_proto_helper.cc", + "test/cpp/util/byte_buffer_proto_helper.h", "test/cpp/util/cli_call.cc", "test/cpp/util/cli_call.h", "test/cpp/util/create_test_channel.cc", @@ -4030,7 +4168,38 @@ "include/grpc++/grpc++.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", @@ -4081,7 +4250,38 @@ "include/grpc++/grpc++.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", @@ -4122,6 +4322,7 @@ "src/cpp/client/credentials.cc", "src/cpp/client/generic_stub.cc", "src/cpp/client/insecure_credentials.cc", + "src/cpp/codegen/grpc_library.cc", "src/cpp/common/call.cc", "src/cpp/common/channel_arguments.cc", "src/cpp/common/completion_queue.cc", @@ -4151,8 +4352,58 @@ { "deps": [], "headers": [ + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", "include/grpc++/support/config.h", "include/grpc++/support/config_protobuf.h", + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", "src/compiler/config.h", "src/compiler/cpp_generator.h", "src/compiler/cpp_generator_helpers.h", @@ -4170,8 +4421,58 @@ "language": "c++", "name": "grpc_plugin_support", "src": [ + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", "include/grpc++/support/config.h", "include/grpc++/support/config_protobuf.h", + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", "src/compiler/config.h", "src/compiler/cpp_generator.cc", "src/compiler/cpp_generator.h", @@ -4189,7 +4490,8 @@ "src/compiler/ruby_generator.h", "src/compiler/ruby_generator_helpers-inl.h", "src/compiler/ruby_generator_map-inl.h", - "src/compiler/ruby_generator_string-inl.h" + "src/compiler/ruby_generator_string-inl.h", + "src/cpp/codegen/grpc_library.cc" ] }, { diff --git a/tools/run_tests/task_runner.py b/tools/run_tests/task_runner.py new file mode 100755 index 0000000000..e5ecc4867b --- /dev/null +++ b/tools/run_tests/task_runner.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +# 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. + +"""Runs selected gRPC test/build tasks.""" + +import argparse +import atexit +import jobset +import multiprocessing +import sys + +import artifact_targets +import distribtest_targets +import package_targets + +_TARGETS = [] +_TARGETS += artifact_targets.targets() +_TARGETS += distribtest_targets.targets() +_TARGETS += package_targets.targets() + +def _create_build_map(): + """Maps task names and labels to list of tasks to be built.""" + target_build_map = dict([(target.name, [target]) + for target in _TARGETS]) + if len(_TARGETS) > len(target_build_map.keys()): + raise Exception('Target names need to be unique') + + label_build_map = {} + label_build_map['all'] = [t for t in _TARGETS] # to build all targets + for target in _TARGETS: + for label in target.labels: + if label in label_build_map: + label_build_map[label].append(target) + else: + label_build_map[label] = [target] + + if set(target_build_map.keys()).intersection(label_build_map.keys()): + raise Exception('Target names need to be distinct from label names') + return dict( target_build_map.items() + label_build_map.items()) + + +_BUILD_MAP = _create_build_map() + +argp = argparse.ArgumentParser(description='Runs build/test targets.') +argp.add_argument('-b', '--build', + choices=sorted(_BUILD_MAP.keys()), + nargs='+', + default=['all'], + help='Target name or target label to build.') +argp.add_argument('-f', '--filter', + choices=sorted(_BUILD_MAP.keys()), + nargs='+', + default=[], + help='Filter targets to build with AND semantics.') +argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int) +argp.add_argument('-t', '--travis', + default=False, + action='store_const', + const=True) + +args = argp.parse_args() + +# Figure out which targets to build +targets = [] +for label in args.build: + targets += _BUILD_MAP[label] + +# Among targets selected by -b, filter out those that don't match the filter +targets = [t for t in targets if all(f in t.labels for f in args.filter)] +targets = sorted(set(targets)) + +# Execute pre-build phase +prebuild_jobs = [] +for target in targets: + prebuild_jobs += target.pre_build_jobspecs() +if prebuild_jobs: + num_failures, _ = jobset.run( + prebuild_jobs, newline_on_success=True, maxjobs=args.jobs) + if num_failures != 0: + jobset.message('FAILED', 'Pre-build phase failed.', do_newline=True) + sys.exit(1) + +build_jobs = [] +for target in targets: + build_jobs.append(target.build_jobspec()) +if not build_jobs: + print 'Nothing to build.' + sys.exit(1) + +jobset.message('START', 'Building targets.', do_newline=True) +num_failures, _ = jobset.run( + build_jobs, newline_on_success=True, maxjobs=args.jobs) +if num_failures == 0: + jobset.message('SUCCESS', 'All targets built successfully.', + do_newline=True) +else: + jobset.message('FAILED', 'Failed to build targets.', + do_newline=True) + sys.exit(1) diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 8c76b3f134..4669d37bb1 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -13,6 +13,26 @@ "exclude_configs": [], "flaky": false, "language": "c", + "name": "alarm_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", "name": "algorithm_test", "platforms": [ "linux", @@ -93,6 +113,26 @@ "exclude_configs": [], "flaky": false, "language": "c", + "name": "census_context_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", "name": "channel_create_test", "platforms": [ "linux", @@ -1404,26 +1444,6 @@ "ci_platforms": [ "linux", "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "tag_set_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, - { - "args": [], - "ci_platforms": [ - "linux", - "mac", "posix" ], "cpu_cost": 0.5, @@ -1984,6 +2004,26 @@ "ci_platforms": [ "linux", "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c++", + "name": "hybrid_end2end_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", "posix" ], "cpu_cost": 0.1, @@ -2433,6 +2473,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2456,6 +2497,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2479,6 +2521,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2502,6 +2545,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2525,6 +2569,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2551,6 +2596,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2577,6 +2623,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2603,6 +2650,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2629,6 +2677,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2655,6 +2704,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2681,6 +2731,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2707,6 +2758,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2733,6 +2785,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2759,6 +2812,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2785,6 +2839,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2811,6 +2866,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2837,6 +2893,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2863,6 +2920,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2889,6 +2947,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2915,6 +2974,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2941,6 +3001,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2967,6 +3028,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -2993,6 +3055,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3019,6 +3082,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3045,6 +3109,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3071,6 +3136,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3097,6 +3163,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3123,6 +3190,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3149,6 +3217,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3174,6 +3243,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3197,6 +3267,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3220,6 +3291,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3245,6 +3317,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3268,6 +3341,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3291,6 +3365,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3314,6 +3389,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3337,6 +3413,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3360,6 +3437,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3383,6 +3461,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3406,6 +3485,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3429,6 +3509,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3452,6 +3533,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3477,6 +3559,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3500,6 +3583,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3523,6 +3607,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3548,6 +3633,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3571,6 +3657,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3594,6 +3681,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3617,6 +3705,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3640,6 +3729,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3665,6 +3755,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3688,6 +3779,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3711,6 +3803,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3734,6 +3827,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3757,6 +3851,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3780,6 +3875,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3803,6 +3899,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3826,6 +3923,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], @@ -3849,6 +3947,7 @@ "windows" ], "cpu_cost": 1.0, + "defaults": "boringssl", "exclude_configs": [ "asan" ], |