diff options
author | 2017-02-14 22:35:01 -0800 | |
---|---|---|
committer | 2017-02-14 22:35:01 -0800 | |
commit | 90e443280a377753eb03511b458850711858274d (patch) | |
tree | dbf84fec826631e1eafd7aff468c1ef653d9810b /tools | |
parent | c15d25a9dbc44c26b0755bb5078920db57c8afd7 (diff) | |
parent | 7e54f14d8084a14d3586f9de00cd9a5211a640fe (diff) |
Merge github.com:grpc/grpc into authority
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/codegen/core/gen_nano_proto.sh | 2 | ||||
-rwxr-xr-x | tools/distrib/pylint_code.sh | 48 | ||||
-rw-r--r-- | tools/doxygen/Doxyfile.c++ | 2 | ||||
-rw-r--r-- | tools/doxygen/Doxyfile.c++.internal | 2 | ||||
-rwxr-xr-x | tools/profiling/latency_profile/run_latency_profile.sh | 2 | ||||
-rwxr-xr-x | tools/profiling/microbenchmarks/bm2bq.py | 162 | ||||
-rw-r--r-- | tools/run_tests/artifacts/artifact_targets.py | 16 | ||||
-rw-r--r-- | tools/run_tests/artifacts/build_artifact_csharp.bat | 10 | ||||
-rw-r--r-- | tools/run_tests/generated/sources_and_headers.json | 7 | ||||
-rw-r--r-- | tools/run_tests/helper_scripts/pre_build_csharp.bat | 13 | ||||
-rwxr-xr-x | tools/run_tests/run_microbenchmark.py | 83 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 27 | ||||
-rw-r--r-- | tools/run_tests/sanity/sanity_tests.yaml | 1 |
13 files changed, 323 insertions, 52 deletions
diff --git a/tools/codegen/core/gen_nano_proto.sh b/tools/codegen/core/gen_nano_proto.sh index 99e49814b8..8600573e1c 100755 --- a/tools/codegen/core/gen_nano_proto.sh +++ b/tools/codegen/core/gen_nano_proto.sh @@ -83,7 +83,7 @@ popd # this should be the same version as the submodule we compile against # ideally we'd update this as a template to ensure that -pip install protobuf==3.0.0 +pip install protobuf==3.2.0 pushd "$(dirname $INPUT_PROTO)" > /dev/null diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh new file mode 100755 index 0000000000..6369e605d5 --- /dev/null +++ b/tools/distrib/pylint_code.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright 2017, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +# change to root directory +cd $(dirname $0)/../.. + +DIRS=src/python/grpcio/grpc + +VIRTUALENV=python_pylint_venv + +virtualenv $VIRTUALENV +PYTHON=`realpath $VIRTUALENV/bin/python` +$PYTHON -m pip install pylint==1.6.5 + +for dir in $DIRS; do + $PYTHON -m pylint --rcfile=.pylintrc -rn $dir || exit $? +done + +exit 0 diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index f215f1b5d1..0706cdca0f 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -810,12 +810,14 @@ 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/core_codegen.h \ include/grpc++/impl/codegen/core_codegen_interface.h \ include/grpc++/impl/codegen/create_auth_context.h \ include/grpc++/impl/codegen/grpc_library.h \ include/grpc++/impl/codegen/metadata_map.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 \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 19b4a9b02d..cb0a3e55f8 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -810,6 +810,7 @@ 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/core_codegen.h \ include/grpc++/impl/codegen/core_codegen.h \ include/grpc++/impl/codegen/core_codegen_interface.h \ @@ -817,6 +818,7 @@ include/grpc++/impl/codegen/create_auth_context.h \ include/grpc++/impl/codegen/grpc_library.h \ include/grpc++/impl/codegen/metadata_map.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 \ diff --git a/tools/profiling/latency_profile/run_latency_profile.sh b/tools/profiling/latency_profile/run_latency_profile.sh index 715f525d2f..e9baee0957 100755 --- a/tools/profiling/latency_profile/run_latency_profile.sh +++ b/tools/profiling/latency_profile/run_latency_profile.sh @@ -44,4 +44,4 @@ else PYTHON=python2.7 fi -$PYTHON tools/run_tests/run_microbenchmark.py bm_fullstack +$PYTHON tools/run_tests/run_microbenchmark.py --collect summary perf latency --bigquery_upload diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py new file mode 100755 index 0000000000..124dbdfec5 --- /dev/null +++ b/tools/profiling/microbenchmarks/bm2bq.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python2.7 +# +# Convert google-benchmark json output to something that can be uploaded to +# BigQuery +# +# +# Copyright 2017, 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 sys +import json +import csv +import os + +columns = [ + ('jenkins_build', 'integer'), + ('jenkins_job', 'string'), + ('date', 'timestamp'), + ('cpu_scaling_enabled', 'boolean'), + ('num_cpus', 'integer'), + ('mhz_per_cpu', 'integer'), + ('library_build_type', 'string'), + ('name', 'string'), + ('fixture', 'string'), + ('client_mutator', 'string'), + ('server_mutator', 'string'), + ('request_size', 'integer'), + ('response_size', 'integer'), + ('request_count', 'integer'), + ('iterations', 'integer'), + ('time_unit', 'string'), + ('real_time', 'integer'), + ('cpu_time', 'integer'), + ('bytes_per_second', 'float'), + ('allocs_per_iteration', 'float'), + ('locks_per_iteration', 'float'), + ('writes_per_iteration', 'float'), +] + +if sys.argv[1] == '--schema': + print ',\n'.join('%s:%s' % (k, t.upper()) for k, t in columns) + sys.exit(0) + +with open(sys.argv[1]) as f: + js = json.loads(f.read()) + +writer = csv.DictWriter(sys.stdout, [c for c,t in columns]) + +bm_specs = { + 'BM_UnaryPingPong': { + 'tpl': ['fixture', 'client_mutator', 'server_mutator'], + 'dyn': ['request_size', 'response_size'], + }, + 'BM_PumpStreamClientToServer': { + 'tpl': ['fixture'], + 'dyn': ['request_size'], + }, + 'BM_PumpStreamServerToClient': { + 'tpl': ['fixture'], + 'dyn': ['request_size'], + }, + 'BM_StreamingPingPong': { + 'tpl': ['fixture', 'client_mutator', 'server_mutator'], + 'dyn': ['request_size', 'request_count'], + }, + 'BM_StreamingPingPongMsgs': { + 'tpl': ['fixture', 'client_mutator', 'server_mutator'], + 'dyn': ['request_size'], + } +} + +def numericalize(s): + if not s: return '' + if s[-1] == 'k': + return int(s[:-1]) * 1024 + if s[-1] == 'M': + return int(s[:-1]) * 1024 * 1024 + if 0 <= (ord(s[-1]) - ord('0')) <= 9: + return int(s) + assert 'not a number: %s' % s + +def parse_name(name): + rest = name + out = {} + tpl_args = [] + dyn_args = [] + if '<' in rest: + tpl_bit = rest[rest.find('<') + 1 : rest.rfind('>')] + arg = '' + nesting = 0 + for c in tpl_bit: + if c == '<': + nesting += 1 + arg += c + elif c == '>': + nesting -= 1 + arg += c + elif c == ',': + if nesting == 0: + tpl_args.append(arg.strip()) + arg = '' + else: + arg += c + else: + arg += c + tpl_args.append(arg.strip()) + rest = rest[:rest.find('<')] + rest[rest.rfind('>') + 1:] + if '/' in rest: + s = rest.split('/') + rest = s[0] + dyn_args = s[1:] + name = rest + assert name in bm_specs + assert len(dyn_args) == len(bm_specs[name]['dyn']) + assert len(tpl_args) == len(bm_specs[name]['tpl']) + out['name'] = name + out.update(dict((k, numericalize(v)) for k, v in zip(bm_specs[name]['dyn'], dyn_args))) + out.update(dict(zip(bm_specs[name]['tpl'], tpl_args))) + return out + +for bm in js['benchmarks']: + context = js['context'] + labels_list = [s.split(':') for s in bm.get('label', '').split(' ')] + for el in labels_list: + el[0] = el[0].replace('/iter', '_per_iteration') + labels = dict(labels_list) + row = { + 'jenkins_build': os.environ.get('BUILD_NUMBER', ''), + 'jenkins_job': os.environ.get('JOB_NAME', ''), + } + row.update(context) + row.update(bm) + row.update(parse_name(row['name'])) + row.update(labels) + del row['label'] + writer.writerow(row) diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py index 005d99790a..aba7b8a305 100644 --- a/tools/run_tests/artifacts/artifact_targets.py +++ b/tools/run_tests/artifacts/artifact_targets.py @@ -183,24 +183,14 @@ class CSharpExtArtifact: self.labels = ['artifact', 'csharp', platform, arch] def pre_build_jobspecs(self): - if self.platform == 'windows': - return [create_jobspec('prebuild_%s' % self.name, - ['tools\\run_tests\\helper_scripts\\pre_build_c.bat'], - shell=True, - flake_retries=5, - timeout_retries=2)] - else: - return [] + return [] def build_jobspec(self): if self.platform == 'windows': - msbuild_platform = 'Win32' if self.arch == 'x86' else self.arch + cmake_arch_option = 'Win32' if self.arch == 'x86' else self.arch return create_jobspec(self.name, ['tools\\run_tests\\artifacts\\build_artifact_csharp.bat', - 'vsprojects\\grpc_csharp_ext.sln', - '/p:Configuration=Release', - '/p:PlatformToolset=v120', - '/p:Platform=%s' % msbuild_platform], + cmake_arch_option], shell=True) else: environ = {'CONFIG': 'opt', diff --git a/tools/run_tests/artifacts/build_artifact_csharp.bat b/tools/run_tests/artifacts/build_artifact_csharp.bat index 24c8d485f9..f84ebc5a35 100644 --- a/tools/run_tests/artifacts/build_artifact_csharp.bat +++ b/tools/run_tests/artifacts/build_artifact_csharp.bat @@ -29,10 +29,16 @@ @rem Builds C# artifacts on Windows -@call vsprojects\build_vs2013.bat %* || goto :error +set ARCHITECTURE=%1 + +@call tools\run_tests\helper_scripts\pre_build_csharp.bat %ARCHITECTURE% || goto :error + +cd cmake\build\%ARCHITECTURE% +cmake --build . --target grpc_csharp_ext --config Release +cd ..\..\.. mkdir artifacts -copy /Y vsprojects\Release\grpc_csharp_ext.dll artifacts || copy /Y vsprojects\x64\Release\grpc_csharp_ext.dll artifacts || goto :error +copy /Y cmake\build\Win32\Release\grpc_csharp_ext.dll artifacts || copy /Y cmake\build\x64\Release\grpc_csharp_ext.dll artifacts || goto :error goto :EOF diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 046076bd10..8756398003 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -5380,7 +5380,8 @@ "grpc", "grpc++_base", "grpc++_codegen_base", - "grpc++_codegen_base_src" + "grpc++_codegen_base_src", + "grpc++_codegen_proto" ], "headers": [ "include/grpc++/impl/codegen/core_codegen.h", @@ -8028,6 +8029,7 @@ "include/grpc/grpc_cronet.h", "include/grpc/grpc_security.h", "include/grpc/grpc_security_constants.h", + "src/core/ext/transport/cronet/transport/cronet_transport.h", "third_party/objective_c/Cronet/bidirectional_stream_c.h" ], "is_filegroup": true, @@ -8039,7 +8041,8 @@ "include/grpc/grpc_security_constants.h", "src/core/ext/transport/cronet/client/secure/cronet_channel_create.c", "src/core/ext/transport/cronet/transport/cronet_api_dummy.c", - "src/core/ext/transport/cronet/transport/cronet_transport.c" + "src/core/ext/transport/cronet/transport/cronet_transport.c", + "src/core/ext/transport/cronet/transport/cronet_transport.h" ], "third_party": false, "type": "filegroup" diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.bat b/tools/run_tests/helper_scripts/pre_build_csharp.bat index 139955d4da..f37f63b584 100644 --- a/tools/run_tests/helper_scripts/pre_build_csharp.bat +++ b/tools/run_tests/helper_scripts/pre_build_csharp.bat @@ -31,9 +31,21 @@ setlocal +set ARCHITECTURE=%1 + @rem enter repo root cd /d %~dp0\..\..\.. +mkdir cmake +cd cmake +mkdir build +cd build +mkdir %ARCHITECTURE% +cd %ARCHITECTURE% +@rem TODO(jtattermusch): Stop hardcoding path to yasm once Jenkins workers can locate yasm correctly +cmake -G "Visual Studio 14 2015" -A %ARCHITECTURE% -DgRPC_BUILD_TESTS=OFF -DCMAKE_ASM_NASM_COMPILER="C:/Program Files (x86)/yasm/yasm.exe" ../../.. || goto :error +cd ..\..\.. + @rem Location of nuget.exe set NUGET=C:\nuget\nuget.exe @@ -42,7 +54,6 @@ if exist %NUGET% ( @rem Restore Grpc packages by packages since Nuget client 3.4.4 doesnt support restore @rem by solution @rem Moving into each directory to let the restores work based on per-project packages.config files - %NUGET% restore vsprojects/grpc_csharp_ext.sln || goto :error cd src/csharp diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index 096d7d78ab..6bba29d74b 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -32,6 +32,7 @@ import multiprocessing import os import subprocess import sys +import argparse import python_utils.jobset as jobset import python_utils.start_port_server as start_port_server @@ -72,12 +73,16 @@ def link(txt, tgt): global index_html index_html += "<p><a href=\"%s\">%s</a></p>\n" % (tgt, txt) -benchmarks = [] -profile_analysis = [] -cleanup = [] +def text(txt): + global index_html + index_html += "<p><pre>%s</pre></p>\n" % txt + +def collect_latency(bm_name, args): + """generate latency profiles""" + benchmarks = [] + profile_analysis = [] + cleanup = [] -for bm_name in sys.argv[1:]: - # generate latency profiles heading('Latency Profiles: %s' % bm_name) subprocess.check_call( ['make', bm_name, @@ -115,26 +120,70 @@ for bm_name in sys.argv[1:]: jobset.run(profile_analysis, maxjobs=multiprocessing.cpu_count()) jobset.run(cleanup, maxjobs=multiprocessing.cpu_count()) - # generate flamegraphs +def collect_perf(bm_name, args): + """generate flamegraphs""" heading('Flamegraphs: %s' % bm_name) subprocess.check_call( ['make', bm_name, 'CONFIG=mutrace', '-j', '%d' % multiprocessing.cpu_count()]) for line in subprocess.check_output(['bins/mutrace/%s' % bm_name, '--benchmark_list_tests']).splitlines(): - subprocess.check_call(['sudo', 'perf', 'record', '-g', '-c', '1000', + subprocess.check_call(['perf', 'record', '-o', '%s-perf.data' % fnize(line), + '-g', '-c', '1000', 'bins/mutrace/%s' % bm_name, '--benchmark_filter=^%s$' % line, - '--benchmark_min_time=20']) - with open('/tmp/bm.perf', 'w') as f: - f.write(subprocess.check_output(['sudo', 'perf', 'script'])) - with open('/tmp/bm.folded', 'w') as f: - f.write(subprocess.check_output([ - '%s/stackcollapse-perf.pl' % flamegraph_dir, '/tmp/bm.perf'])) - link(line, '%s.svg' % fnize(line)) - with open('reports/%s.svg' % fnize(line), 'w') as f: - f.write(subprocess.check_output([ - '%s/flamegraph.pl' % flamegraph_dir, '/tmp/bm.folded'])) + '--benchmark_min_time=10']) + env = os.environ.copy() + env.update({ + 'PERF_BASE_NAME': fnize(line), + 'OUTPUT_DIR': 'reports', + 'OUTPUT_FILENAME': fnize(line), + }) + subprocess.check_call(['tools/run_tests/performance/process_local_perf_flamegraphs.sh'], + env=env) + subprocess.check_call(['rm', '%s-perf.data' % fnize(line)]) + subprocess.check_call(['rm', '%s-out.perf' % fnize(line)]) + +def collect_summary(bm_name, args): + heading('Summary: %s' % bm_name) + subprocess.check_call( + ['make', bm_name, + 'CONFIG=counters', '-j', '%d' % multiprocessing.cpu_count()]) + text(subprocess.check_output(['bins/counters/%s' % bm_name, + '--benchmark_out=out.json', + '--benchmark_out_format=json'])) + if args.bigquery_upload: + with open('out.csv', 'w') as f: + f.write(subprocess.check_output(['tools/profiling/microbenchmarks/bm2bq.py', 'out.json'])) + subprocess.check_call(['bq', 'load', 'microbenchmarks.microbenchmarks', 'out.csv']) + +collectors = { + 'latency': collect_latency, + 'perf': collect_perf, + 'summary': collect_summary, +} + +argp = argparse.ArgumentParser(description='Collect data from microbenchmarks') +argp.add_argument('-c', '--collect', + choices=sorted(collectors.keys()), + nargs='+', + default=sorted(collectors.keys()), + help='Which collectors should be run against each benchmark') +argp.add_argument('-b', '--benchmarks', + default=['bm_fullstack'], + nargs='+', + type=str, + help='Which microbenchmarks should be run') +argp.add_argument('--bigquery_upload', + default=False, + action='store_const', + const=True, + help='Upload results from summary collection to bigquery') +args = argp.parse_args() + +for bm_name in args.benchmarks: + for collect in args.collect: + collectors[collect](bm_name, args) index_html += "</body>\n</html>\n" with open('reports/index.html', 'w') as f: diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 75571aaadb..8b76193cbe 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -722,12 +722,10 @@ class CSharpLanguage(object): self.config = config self.args = args if self.platform == 'windows': - # Explicitly choosing between x86 and x64 arch doesn't work yet + _check_compiler(self.args.compiler, ['coreclr', 'default']) _check_arch(self.args.arch, ['default']) - # CoreCLR use 64bit runtime by default. - arch_option = 'x64' if self.args.compiler == 'coreclr' else self.args.arch - self._make_options = [_windows_toolset_option(self.args.compiler), - _windows_arch_option(arch_option)] + self._cmake_arch_option = 'x64' if self.args.compiler == 'coreclr' else 'Win32' + self._make_options = [] else: _check_compiler(self.args.compiler, ['default', 'coreclr']) if self.platform == 'linux' and self.args.compiler == 'coreclr': @@ -799,7 +797,7 @@ class CSharpLanguage(object): def pre_build_steps(self): if self.platform == 'windows': - return [['tools\\run_tests\\helper_scripts\\pre_build_csharp.bat']] + return [['tools\\run_tests\\helper_scripts\\pre_build_csharp.bat', self._cmake_arch_option]] else: return [['tools/run_tests/helper_scripts/pre_build_csharp.sh']] @@ -817,7 +815,7 @@ class CSharpLanguage(object): return [['tools/run_tests/helper_scripts/build_csharp_coreclr.sh']] else: if self.platform == 'windows': - return [[_windows_build_bat(self.args.compiler), + return [['vsprojects\\build_vs2015.bat', 'src/csharp/Grpc.sln', '/p:Configuration=%s' % _MSBUILD_CONFIG[self.config.build_config]]] else: @@ -830,7 +828,10 @@ class CSharpLanguage(object): return [['tools/run_tests/helper_scripts/post_tests_csharp.sh']] def makefile_name(self): - return 'Makefile' + if self.platform == 'windows': + return 'cmake/build/%s/Makefile' % self._cmake_arch_option + else: + return 'Makefile' def dockerfile_dir(self): return 'tools/dockerfile/test/csharp_%s_%s' % (self._docker_distro, @@ -1038,12 +1039,10 @@ def _check_arch_option(arch): def _windows_build_bat(compiler): """Returns name of build.bat for selected compiler.""" # For CoreCLR, fall back to the default compiler for C core - if compiler == 'default' or compiler == 'vs2013' or compiler == 'coreclr': + if compiler == 'default' or compiler == 'vs2013': return 'vsprojects\\build_vs2013.bat' elif compiler == 'vs2015': return 'vsprojects\\build_vs2015.bat' - elif compiler == 'vs2010': - return 'vsprojects\\build_vs2010.bat' else: print('Compiler %s not supported.' % compiler) sys.exit(1) @@ -1056,8 +1055,6 @@ def _windows_toolset_option(compiler): return '/p:PlatformToolset=v120' elif compiler == 'vs2015': return '/p:PlatformToolset=v140' - elif compiler == 'vs2010': - return '/p:PlatformToolset=v100' else: print('Compiler %s not supported.' % compiler) sys.exit(1) @@ -1147,7 +1144,7 @@ argp.add_argument('--compiler', choices=['default', 'gcc4.4', 'gcc4.6', 'gcc4.8', 'gcc4.9', 'gcc5.3', 'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7', - 'vs2010', 'vs2013', 'vs2015', + 'vs2013', 'vs2015', 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'node0.12', 'node4', 'node5', 'node6', 'node7', 'electron1.3', @@ -1292,7 +1289,7 @@ def make_jobspec(cfg, targets, makefile='Makefile'): return [jobset.JobSpec(['cmake', '--build', '.', '--target', '%s' % target, '--config', _MSBUILD_CONFIG[cfg]], - cwd='cmake/build', + cwd=os.path.dirname(makefile), timeout_seconds=None) for target in targets] extra_args = [] # better do parallel compilation diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index ce41da802d..445f53e555 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -12,6 +12,7 @@ - script: tools/distrib/check_trailing_newlines.sh - script: tools/distrib/check_nanopb_output.sh - script: tools/distrib/check_include_guards.py +- script: tools/distrib/pylint_code.sh - script: tools/distrib/yapf_code.sh - script: tools/distrib/python/check_grpcio_tools.py |