From 3da3ce3c29ab169faa7670f471eeaebcdbc19d6e Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 17 Feb 2017 09:51:25 -0800 Subject: Add error test --- tools/run_tests/generated/sources_and_headers.json | 17 +++++++++++++++++ tools/run_tests/generated/tests.json | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'tools') diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index b04e4bd06f..9256d72db7 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -421,6 +421,23 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c", + "name": "error_test", + "src": [ + "test/core/iomgr/error_test.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index d93b55a023..a7d6b6a8c6 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -515,6 +515,28 @@ "windows" ] }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 30, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c", + "name": "error_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, { "args": [], "ci_platforms": [ -- cgit v1.2.3 From b699640a773d74e07bbcf5ded4a86d14e49e1a04 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 6 Mar 2017 16:10:20 -0800 Subject: Factor out benchmark parsing code to enable diffs more easily --- tools/profiling/microbenchmarks/bm2bq.py | 137 +---------------------- tools/profiling/microbenchmarks/bm_json.py | 167 +++++++++++++++++++++++++++++ 2 files changed, 172 insertions(+), 132 deletions(-) create mode 100644 tools/profiling/microbenchmarks/bm_json.py (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py index 280f217e69..ffb158a28d 100755 --- a/tools/profiling/microbenchmarks/bm2bq.py +++ b/tools/profiling/microbenchmarks/bm2bq.py @@ -36,7 +36,7 @@ import sys import json import csv -import os +import bm_json columns = [ ('jenkins_build', 'integer'), @@ -82,137 +82,10 @@ with open(sys.argv[1]) as f: 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'], - }, - 'BM_PumpStreamServerToClient_Trickle': { - 'tpl': [], - 'dyn': ['request_size', 'bandwidth_kilobits'], - }, - 'BM_ErrorStringOnNewError': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorStringRepeatedly': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorGetStatus': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorGetStatusCode': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorHttpError': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_HasClearGrpcStatus': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_IsolatedFilter' : { - 'tpl': ['fixture', 'client_mutator'], - 'dyn': [], - }, - 'BM_HpackEncoderEncodeHeader' : { - 'tpl': ['fixture'], - 'dyn': ['end_of_stream', 'request_size'], - }, - 'BM_HpackParserParseHeader' : { - 'tpl': ['fixture'], - 'dyn': [], - }, -} - -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): - if '<' not in name and '/' not in name and name not in bm_specs: - return {'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, 'bm_specs needs to be expanded for %s' % name - 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'] - if 'label' in bm: - labels_list = [s.split(':') for s in bm['label'].strip().split(' ') if len(s) and s[0] != '#'] - for el in labels_list: - el[0] = el[0].replace('/iter', '_per_iteration') - labels = dict(labels_list) - else: - labels = {} - 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) +for row in bm_json.expand_json(js): if 'label' in row: del row['label'] + del row['cpp_name'] writer.writerow(row) + + diff --git a/tools/profiling/microbenchmarks/bm_json.py b/tools/profiling/microbenchmarks/bm_json.py new file mode 100644 index 0000000000..dd07719b2a --- /dev/null +++ b/tools/profiling/microbenchmarks/bm_json.py @@ -0,0 +1,167 @@ +# 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 os + +_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'], + }, + 'BM_PumpStreamServerToClient_Trickle': { + 'tpl': [], + 'dyn': ['request_size', 'bandwidth_kilobits'], + }, + 'BM_ErrorStringOnNewError': { + 'tpl': ['fixture'], + 'dyn': [], + }, + 'BM_ErrorStringRepeatedly': { + 'tpl': ['fixture'], + 'dyn': [], + }, + 'BM_ErrorGetStatus': { + 'tpl': ['fixture'], + 'dyn': [], + }, + 'BM_ErrorGetStatusCode': { + 'tpl': ['fixture'], + 'dyn': [], + }, + 'BM_ErrorHttpError': { + 'tpl': ['fixture'], + 'dyn': [], + }, + 'BM_HasClearGrpcStatus': { + 'tpl': ['fixture'], + 'dyn': [], + }, + 'BM_IsolatedFilter' : { + 'tpl': ['fixture', 'client_mutator'], + 'dyn': [], + }, + 'BM_HpackEncoderEncodeHeader' : { + 'tpl': ['fixture'], + 'dyn': ['end_of_stream', 'request_size'], + }, + 'BM_HpackParserParseHeader' : { + 'tpl': ['fixture'], + 'dyn': [], + }, +} + +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): + cpp_name = name + if '<' not in name and '/' not in name and name not in _BM_SPECS: + return {'name': name, 'cpp_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, '_BM_SPECS needs to be expanded for %s' % name + assert len(dyn_args) == len(_BM_SPECS[name]['dyn']) + assert len(tpl_args) == len(_BM_SPECS[name]['tpl']) + out['name'] = name + out['cpp_name'] = cpp_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 + +def expand_json(js): + for bm in js['benchmarks']: + context = js['context'] + if 'label' in bm: + labels_list = [s.split(':') for s in bm['label'].strip().split(' ') if len(s) and s[0] != '#'] + for el in labels_list: + el[0] = el[0].replace('/iter', '_per_iteration') + labels = dict(labels_list) + else: + labels = {} + 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) + yield row + -- cgit v1.2.3 From 3651eece9b387e2d4199a92ca4a22c3c50c39b93 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 6 Mar 2017 16:15:48 -0800 Subject: Fix merge error --- tools/profiling/microbenchmarks/bm2bq.py | 140 ------------------------------- 1 file changed, 140 deletions(-) (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py index 1797778603..ae59332f1b 100755 --- a/tools/profiling/microbenchmarks/bm2bq.py +++ b/tools/profiling/microbenchmarks/bm2bq.py @@ -88,148 +88,8 @@ else: writer = csv.DictWriter(sys.stdout, [c for c,t in columns]) -<<<<<<< HEAD for row in bm_json.expand_json(js, js2): -======= -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'], - }, - 'BM_PumpStreamServerToClient_Trickle': { - 'tpl': [], - 'dyn': ['request_size', 'bandwidth_kilobits'], - }, - 'BM_ErrorStringOnNewError': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorStringRepeatedly': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorGetStatus': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorGetStatusCode': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_ErrorHttpError': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_HasClearGrpcStatus': { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_IsolatedFilter' : { - 'tpl': ['fixture', 'client_mutator'], - 'dyn': [], - }, - 'BM_HpackEncoderEncodeHeader' : { - 'tpl': ['fixture'], - 'dyn': ['end_of_stream', 'request_size'], - }, - 'BM_HpackParserParseHeader' : { - 'tpl': ['fixture'], - 'dyn': [], - }, - 'BM_CallCreateDestroy' : { - 'tpl': ['fixture'], - 'dyn': [], - }, -} - -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): - if '<' not in name and '/' not in name and name not in bm_specs: - return {'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, 'bm_specs needs to be expanded for %s' % name - 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'] - if 'label' in bm: - labels_list = [s.split(':') for s in bm['label'].strip().split(' ') if len(s) and s[0] != '#'] - for el in labels_list: - el[0] = el[0].replace('/iter', '_per_iteration') - labels = dict(labels_list) - else: - labels = {} - 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) ->>>>>>> cf54c151f1853af1fe1df2058ccbc2ca3a26c43c if 'label' in row: del row['label'] del row['cpp_name'] writer.writerow(row) - - -- cgit v1.2.3 From eb24a7bd847409091893e0f75f97fecaff99ebcf Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 17:04:46 -0800 Subject: Use new diff script --- tools/profiling/microbenchmarks/bm_diff.py | 0 tools/run_tests/run_microbenchmark.py | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 tools/profiling/microbenchmarks/bm_diff.py (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index 3a9461ecd3..0b5fc5ec46 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -228,8 +228,10 @@ for bm_name in args.benchmarks: for collect in args.collect: collectors[collect](bm_name, args) if args.diff_perf: - for bm_name in args.benchmarks: - run_summary(bm_name, 'opt', '%s.new' % bm_name) + if 'summary' not in args.collect: + for bm_name in args.benchmarks: + run_summary(bm_name, 'opt', bm_name) + run_summary(bm_name, 'counters', bm_name) where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() subprocess.check_call(['git', 'checkout', args.diff_perf]) comparables = [] @@ -238,15 +240,21 @@ if args.diff_perf: for bm_name in args.benchmarks: try: run_summary(bm_name, 'opt', '%s.old' % bm_name) + run_summary(bm_name, 'counters', '%s.old' % bm_name) comparables.append(bm_name) except subprocess.CalledProcessError, e: pass finally: subprocess.check_call(['git', 'checkout', where_am_i]) for bm_name in comparables: - subprocess.check_call(['third_party/benchmark/tools/compare_bench.py', - '%s.new.opt.json' % bm_name, - '%s.old.opt.json' % bm_name]) + diff = subprocess.check_output(['tools/profiling/microbenchmarks/bm_diff.py', + '%s.opt.json' % bm_name, + '%s.counters.json' % bm_name, + '%s.old.opt.json' % bm_name, + '%s.old.counters.json' % bm_name]).strip() + if diff: + heading('Performance diff: %s' % bm_name) + text(diff) index_html += "\n\n" with open('reports/index.html', 'w') as f: -- cgit v1.2.3 From 1fabdfb870d29c1fad40a882d1029494d9fcb425 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Tue, 7 Mar 2017 17:18:31 -0800 Subject: Add more Kokoro job configs --- tools/internal_ci/linux/grpc_master.sh | 2 + tools/internal_ci/linux/grpc_master_sanitizers.cfg | 39 +++++++++++++++++ tools/internal_ci/linux/grpc_master_sanitizers.sh | 48 +++++++++++++++++++++ tools/internal_ci/linux/grpc_portability.cfg | 39 +++++++++++++++++ tools/internal_ci/linux/grpc_portability.sh | 49 ++++++++++++++++++++++ .../windows/grpc_portability_master.bat | 43 +++++++++++++++++++ .../windows/grpc_portability_master.cfg | 39 +++++++++++++++++ 7 files changed, 259 insertions(+) create mode 100644 tools/internal_ci/linux/grpc_master_sanitizers.cfg create mode 100644 tools/internal_ci/linux/grpc_master_sanitizers.sh create mode 100644 tools/internal_ci/linux/grpc_portability.cfg create mode 100644 tools/internal_ci/linux/grpc_portability.sh create mode 100644 tools/internal_ci/windows/grpc_portability_master.bat create mode 100644 tools/internal_ci/windows/grpc_portability_master.cfg (limited to 'tools') diff --git a/tools/internal_ci/linux/grpc_master.sh b/tools/internal_ci/linux/grpc_master.sh index d01d6375e9..9ecf123959 100755 --- a/tools/internal_ci/linux/grpc_master.sh +++ b/tools/internal_ci/linux/grpc_master.sh @@ -45,6 +45,8 @@ ulimit -n 2000 git submodule update --init +# download docker images from dockerhub +export DOCKERHUB_ORGANIZATION=grpctesting tools/run_tests/run_tests.py -l c -t -x sponge_log.xml || FAILED="true" # kill port_server.py to prevent the build from hanging diff --git a/tools/internal_ci/linux/grpc_master_sanitizers.cfg b/tools/internal_ci/linux/grpc_master_sanitizers.cfg new file mode 100644 index 0000000000..64ad23e214 --- /dev/null +++ b/tools/internal_ci/linux/grpc_master_sanitizers.cfg @@ -0,0 +1,39 @@ +# 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. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/linux/grpc_master_sanitizers.sh" +timeout_mins: 1440 +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/tools/internal_ci/linux/grpc_master_sanitizers.sh b/tools/internal_ci/linux/grpc_master_sanitizers.sh new file mode 100644 index 0000000000..b174c9b174 --- /dev/null +++ b/tools/internal_ci/linux/grpc_master_sanitizers.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 grpc repo root +cd $(dirname $0)/../../.. + +git submodule update --init + +# download docker images from dockerhub +export DOCKERHUB_ORGANIZATION=grpctesting +tools/jenkins/run_jenkins_matrix.sh -f sanitizers linux + +# kill port_server.py to prevent the build from hanging +ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9 + +if [ "$FAILED" != "" ] +then + exit 1 +fi diff --git a/tools/internal_ci/linux/grpc_portability.cfg b/tools/internal_ci/linux/grpc_portability.cfg new file mode 100644 index 0000000000..e6e9a9085b --- /dev/null +++ b/tools/internal_ci/linux/grpc_portability.cfg @@ -0,0 +1,39 @@ +# 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. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/linux/grpc_portability.sh" +timeout_mins: 360 +action { + define_artifacts { + regex: "**report**.xml" + } +} diff --git a/tools/internal_ci/linux/grpc_portability.sh b/tools/internal_ci/linux/grpc_portability.sh new file mode 100644 index 0000000000..a7460e5a50 --- /dev/null +++ b/tools/internal_ci/linux/grpc_portability.sh @@ -0,0 +1,49 @@ +#!/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 grpc repo root +cd $(dirname $0)/../../.. + +git submodule update --init + +# download docker images from dockerhub +export DOCKERHUB_ORGANIZATION=grpctesting +tools/jenkins/run_jenkins_matrix.sh -f portability linux + +# kill port_server.py to prevent the build from hanging +ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9 + +if [ "$FAILED" != "" ] +then + exit 1 +fi + diff --git a/tools/internal_ci/windows/grpc_portability_master.bat b/tools/internal_ci/windows/grpc_portability_master.bat new file mode 100644 index 0000000000..b98c70146c --- /dev/null +++ b/tools/internal_ci/windows/grpc_portability_master.bat @@ -0,0 +1,43 @@ +@rem Copyright 2017, Google Inc. +@rem All rights reserved. +@rem +@rem Redistribution and use in source and binary forms, with or without +@rem modification, are permitted provided that the following conditions are +@rem met: +@rem +@rem * Redistributions of source code must retain the above copyright +@rem notice, this list of conditions and the following disclaimer. +@rem * Redistributions in binary form must reproduce the above +@rem copyright notice, this list of conditions and the following disclaimer +@rem in the documentation and/or other materials provided with the +@rem distribution. +@rem * Neither the name of Google Inc. nor the names of its +@rem contributors may be used to endorse or promote products derived from +@rem this software without specific prior written permission. +@rem +@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@rem make sure msys binaries are preferred over cygwin binaries +@rem set path to python 2.7 +set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH% + +@rem enter repo root +cd /d %~dp0\..\..\.. + +git submodule update --init + +python tools/run_tests/run_tests_matrix.py -f portability windows -j 1 --inner_jobs 8 || goto :error +goto :EOF + +:error +exit /b %errorlevel% diff --git a/tools/internal_ci/windows/grpc_portability_master.cfg b/tools/internal_ci/windows/grpc_portability_master.cfg new file mode 100644 index 0000000000..fa6fd8b276 --- /dev/null +++ b/tools/internal_ci/windows/grpc_portability_master.cfg @@ -0,0 +1,39 @@ +# 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. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/windows/grpc_portability_master.bat" +timeout_mins: 360 +action { + define_artifacts { + regex: "**sponge_log.xml" + } +} -- cgit v1.2.3 From 76fc48bc5cff0886493ff39ecbdd3db8a84ceb91 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 17:21:16 -0800 Subject: Start of diff script --- tools/profiling/microbenchmarks/bm_diff.py | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) mode change 100644 => 100755 tools/profiling/microbenchmarks/bm_diff.py (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py old mode 100644 new mode 100755 index e69de29bb2..4dbcc768f7 --- a/tools/profiling/microbenchmarks/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python2.7 + +import sys +import json +import bm_json + +with open(sys.argv[1]) as f: + js_new_ctr = json.loads(f.read()) +with open(sys.argv[2]) as f: + js_new_opt = json.loads(f.read()) +with open(sys.argv[3]) as f: + js_old_ctr = json.loads(f.read()) +with open(sys.argv[4]) as f: + js_old_opt = json.loads(f.read()) + +new = {} +old = {} + +for row in bm_json.expand_json(js_new_ctr, js_new_opt): + new[row['cpp_name']] = row +for row in bm_json.expand_json(js_old_ctr, js_old_opt): + old[row['cpp_name']] = row + +def min_change(pct): + return lambda n, o: abs((n-o)/o - 1) > pct/100 + +_INTERESTING = ( + ('cpu_time', min_change(5)), + ('real_time', min_change(5)), +) + +for bm in sorted(new.keys()): + if bm not in old: continue + hdr = False + n = new[bm] + o = old[bm] + print n + print o + for fld, chk in _INTERESTING: + if fld not in n or fld not in o: continue + if chk(n[fld], o[fld]): + if not hdr: + print '%s shows changes:' % bm + hdr = True + print ' %s changed %r --> %r' % (fld, o[fld], n[fld]) + sys.exit(0) + -- cgit v1.2.3 From 8809afd0abdbbc83d45d225955dff064903334cf Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Tue, 7 Mar 2017 17:29:00 -0800 Subject: Update regex to find sponge_log.xml --- tools/internal_ci/linux/grpc_master.cfg | 2 +- tools/internal_ci/linux/grpc_master_sanitizers.cfg | 2 +- tools/internal_ci/linux/grpc_portability.cfg | 2 +- tools/internal_ci/linux/grpc_portability_build_only.cfg | 2 +- tools/internal_ci/linux/grpc_portability_build_only.sh | 1 - tools/internal_ci/linux/grpc_pull_request_sanity.cfg | 2 +- tools/internal_ci/windows/grpc_master.cfg | 2 +- tools/internal_ci/windows/grpc_portability_master.cfg | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/internal_ci/linux/grpc_master.cfg b/tools/internal_ci/linux/grpc_master.cfg index 7536a91a67..6c94c3b4d8 100644 --- a/tools/internal_ci/linux/grpc_master.cfg +++ b/tools/internal_ci/linux/grpc_master.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/linux/grpc_master.sh" timeout_mins: 240 action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/*sponge_log.xml" } } diff --git a/tools/internal_ci/linux/grpc_master_sanitizers.cfg b/tools/internal_ci/linux/grpc_master_sanitizers.cfg index 64ad23e214..a2a9407128 100644 --- a/tools/internal_ci/linux/grpc_master_sanitizers.cfg +++ b/tools/internal_ci/linux/grpc_master_sanitizers.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/linux/grpc_master_sanitizers.sh" timeout_mins: 1440 action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/*sponge_log.xml" } } diff --git a/tools/internal_ci/linux/grpc_portability.cfg b/tools/internal_ci/linux/grpc_portability.cfg index e6e9a9085b..0c25661d62 100644 --- a/tools/internal_ci/linux/grpc_portability.cfg +++ b/tools/internal_ci/linux/grpc_portability.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/linux/grpc_portability.sh" timeout_mins: 360 action { define_artifacts { - regex: "**report**.xml" + regex: "**/*sponge_log.xml" } } diff --git a/tools/internal_ci/linux/grpc_portability_build_only.cfg b/tools/internal_ci/linux/grpc_portability_build_only.cfg index ce5be5abe9..4d3dda4082 100644 --- a/tools/internal_ci/linux/grpc_portability_build_only.cfg +++ b/tools/internal_ci/linux/grpc_portability_build_only.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/linux/grpc_portability_build_only.sh" timeout_mins: 180 action { define_artifacts { - regex: "**report**.xml" + regex: "**/*sponge_log.xml" } } diff --git a/tools/internal_ci/linux/grpc_portability_build_only.sh b/tools/internal_ci/linux/grpc_portability_build_only.sh index ebdc0e82d7..92678c15f8 100644 --- a/tools/internal_ci/linux/grpc_portability_build_only.sh +++ b/tools/internal_ci/linux/grpc_portability_build_only.sh @@ -37,5 +37,4 @@ git submodule update --init # download docker images from dockerhub export DOCKERHUB_ORGANIZATION=grpctesting - tools/jenkins/run_jenkins_matrix.sh -f portability linux --build_only diff --git a/tools/internal_ci/linux/grpc_pull_request_sanity.cfg b/tools/internal_ci/linux/grpc_pull_request_sanity.cfg index 511f2d6b35..1abf6ac600 100644 --- a/tools/internal_ci/linux/grpc_pull_request_sanity.cfg +++ b/tools/internal_ci/linux/grpc_pull_request_sanity.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/linux/grpc_sanity.sh" timeout_mins: 30 action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/*sponge_log.xml" } } diff --git a/tools/internal_ci/windows/grpc_master.cfg b/tools/internal_ci/windows/grpc_master.cfg index f90af11308..21a9d6a985 100644 --- a/tools/internal_ci/windows/grpc_master.cfg +++ b/tools/internal_ci/windows/grpc_master.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/windows/grpc_master.bat" timeout_mins: 360 action { define_artifacts { - regex: "**sponge_log.xml" + regex: "**/*sponge_log.xml" } } diff --git a/tools/internal_ci/windows/grpc_portability_master.cfg b/tools/internal_ci/windows/grpc_portability_master.cfg index fa6fd8b276..10d8e98591 100644 --- a/tools/internal_ci/windows/grpc_portability_master.cfg +++ b/tools/internal_ci/windows/grpc_portability_master.cfg @@ -34,6 +34,6 @@ build_file: "grpc/tools/internal_ci/windows/grpc_portability_master.bat" timeout_mins: 360 action { define_artifacts { - regex: "**sponge_log.xml" + regex: "**/*sponge_log.xml" } } -- cgit v1.2.3 From 4751c28b0b371eaa6fd17583e06e740989b62b86 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 10 Jan 2017 14:29:00 -0800 Subject: Add channel arguments to server builder --- CMakeLists.txt | 6 ++ Makefile | 6 ++ build.yaml | 2 + include/grpc++/impl/channel_argument_option.h | 52 +++++++++++++++ include/grpc++/server_builder.h | 8 +++ src/cpp/server/channel_argument_option.cc | 78 ++++++++++++++++++++++ tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 2 + tools/run_tests/generated/sources_and_headers.json | 3 + vsprojects/vcxproj/grpc++/grpc++.vcxproj | 3 + vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 6 ++ .../grpc++_unsecure/grpc++_unsecure.vcxproj | 3 + .../grpc++_unsecure.vcxproj.filters | 6 ++ 13 files changed, 176 insertions(+) create mode 100644 include/grpc++/impl/channel_argument_option.h create mode 100644 src/cpp/server/channel_argument_option.cc (limited to 'tools') diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d578eebd..d4c2792523 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2078,6 +2078,7 @@ add_library(grpc++ src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc + src/cpp/server/channel_argument_option.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/dynamic_thread_pool.cc src/cpp/server/health/default_health_check_service.cc @@ -2143,6 +2144,7 @@ foreach(_hdr include/grpc++/grpc++.h include/grpc++/health_check_service_interface.h include/grpc++/impl/call.h + include/grpc++/impl/channel_argument_option.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/codegen/core_codegen.h include/grpc++/impl/grpc_library.h @@ -2264,6 +2266,7 @@ add_library(grpc++_cronet src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc + src/cpp/server/channel_argument_option.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/dynamic_thread_pool.cc src/cpp/server/health/default_health_check_service.cc @@ -2513,6 +2516,7 @@ foreach(_hdr include/grpc++/grpc++.h include/grpc++/health_check_service_interface.h include/grpc++/impl/call.h + include/grpc++/impl/channel_argument_option.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/codegen/core_codegen.h include/grpc++/impl/grpc_library.h @@ -2935,6 +2939,7 @@ add_library(grpc++_unsecure src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc + src/cpp/server/channel_argument_option.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/dynamic_thread_pool.cc src/cpp/server/health/default_health_check_service.cc @@ -3000,6 +3005,7 @@ foreach(_hdr include/grpc++/grpc++.h include/grpc++/health_check_service_interface.h include/grpc++/impl/call.h + include/grpc++/impl/channel_argument_option.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/codegen/core_codegen.h include/grpc++/impl/grpc_library.h diff --git a/Makefile b/Makefile index 57e877beb0..9542f17de9 100644 --- a/Makefile +++ b/Makefile @@ -3919,6 +3919,7 @@ LIBGRPC++_SRC = \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ + src/cpp/server/channel_argument_option.cc \ src/cpp/server/create_default_thread_pool.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health/default_health_check_service.cc \ @@ -3951,6 +3952,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/grpc++.h \ include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ + include/grpc++/impl/channel_argument_option.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ include/grpc++/impl/grpc_library.h \ @@ -4118,6 +4120,7 @@ LIBGRPC++_CRONET_SRC = \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ + src/cpp/server/channel_argument_option.cc \ src/cpp/server/create_default_thread_pool.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health/default_health_check_service.cc \ @@ -4333,6 +4336,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/grpc++.h \ include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ + include/grpc++/impl/channel_argument_option.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ include/grpc++/impl/grpc_library.h \ @@ -4801,6 +4805,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ + src/cpp/server/channel_argument_option.cc \ src/cpp/server/create_default_thread_pool.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health/default_health_check_service.cc \ @@ -4833,6 +4838,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/grpc++.h \ include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ + include/grpc++/impl/channel_argument_option.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ include/grpc++/impl/grpc_library.h \ diff --git a/build.yaml b/build.yaml index 9ff37d59e1..5d96524f27 100644 --- a/build.yaml +++ b/build.yaml @@ -776,6 +776,7 @@ filegroups: - include/grpc++/grpc++.h - include/grpc++/health_check_service_interface.h - include/grpc++/impl/call.h + - include/grpc++/impl/channel_argument_option.h - include/grpc++/impl/client_unary_call.h - include/grpc++/impl/codegen/core_codegen.h - include/grpc++/impl/grpc_library.h @@ -832,6 +833,7 @@ filegroups: - src/cpp/common/rpc_method.cc - src/cpp/common/version_cc.cc - src/cpp/server/async_generic_service.cc + - src/cpp/server/channel_argument_option.cc - src/cpp/server/create_default_thread_pool.cc - src/cpp/server/dynamic_thread_pool.cc - src/cpp/server/health/default_health_check_service.cc diff --git a/include/grpc++/impl/channel_argument_option.h b/include/grpc++/impl/channel_argument_option.h new file mode 100644 index 0000000000..057acc2ceb --- /dev/null +++ b/include/grpc++/impl/channel_argument_option.h @@ -0,0 +1,52 @@ +/* + * + * 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. + * + */ + +#ifndef GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H +#define GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H + +#include +#include + +#include +#include + +namespace grpc { + +std::unique_ptr MakeChannelArgumentOption( + const grpc::string &name, const grpc::string &value); +std::unique_ptr MakeChannelArgumentOption( + const grpc::string &name, int value); + +} // namespace grpc + +#endif // GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 2ac2f0a1ef..d707100a52 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -130,6 +131,13 @@ class ServerBuilder { /// Only useful if this is a Synchronous server. ServerBuilder& SetSyncServerOption(SyncServerOption option, int value); + /// Add a channel argument (an escape hatch to tuning core library parameters + /// directly) + template + ServerBuilder& AddChannelArgument(const grpc::string& arg, const T& value) { + return SetOption(MakeChannelArgumentOption(arg, value)); + } + /// Tries to bind \a server to the given \a addr. /// /// It can be invoked multiple times. diff --git a/src/cpp/server/channel_argument_option.cc b/src/cpp/server/channel_argument_option.cc new file mode 100644 index 0000000000..723f968ff8 --- /dev/null +++ b/src/cpp/server/channel_argument_option.cc @@ -0,0 +1,78 @@ +/* + * + * 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. + * + */ + +#include + +namespace grpc { + +std::unique_ptr MakeChannelArgumentOption( + const grpc::string &name, const grpc::string &value) { + class StringOption final : public ServerBuilderOption { + public: + StringOption(const grpc::string &name, const grpc::string &value) + : name_(name), value_(value) {} + + virtual void UpdateArguments(ChannelArguments *args) override { + args->SetString(name_, value_); + } + virtual void UpdatePlugins( + std::vector> *plugins) override {} + + private: + const grpc::string name_; + const grpc::string value_; + }; + return std::unique_ptr(new StringOption(name, value)); +} + +std::unique_ptr MakeChannelArgumentOption( + const grpc::string &name, int value) { + class IntOption final : public ServerBuilderOption { + public: + IntOption(const grpc::string &name, int value) + : name_(name), value_(value) {} + + virtual void UpdateArguments(ChannelArguments *args) override { + args->SetInt(name_, value_); + } + virtual void UpdatePlugins( + std::vector> *plugins) override {} + + private: + const grpc::string name_; + const int value_; + }; + return std::unique_ptr(new IntOption(name, value)); +} + +} // namespace grpc diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 551ba46b3b..b0ff5e7f8b 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -801,6 +801,7 @@ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ +include/grpc++/impl/channel_argument_option.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/async_stream.h \ include/grpc++/impl/codegen/async_unary_call.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 0d7ddfc6d6..5d3e5ed24f 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -801,6 +801,7 @@ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ +include/grpc++/impl/channel_argument_option.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/async_stream.h \ include/grpc++/impl/codegen/async_unary_call.h \ @@ -912,6 +913,7 @@ src/cpp/common/secure_channel_arguments.cc \ src/cpp/common/secure_create_auth_context.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ +src/cpp/server/channel_argument_option.cc \ src/cpp/server/create_default_thread_pool.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/dynamic_thread_pool.h \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 15bcf5621e..99942609dc 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -8253,6 +8253,7 @@ "include/grpc++/grpc++.h", "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", + "include/grpc++/impl/channel_argument_option.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", "include/grpc++/impl/grpc_library.h", @@ -8309,6 +8310,7 @@ "include/grpc++/grpc++.h", "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", + "include/grpc++/impl/channel_argument_option.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", "include/grpc++/impl/grpc_library.h", @@ -8358,6 +8360,7 @@ "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", + "src/cpp/server/channel_argument_option.cc", "src/cpp/server/create_default_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.h", diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index 45f3037e8a..c85454a6dd 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -270,6 +270,7 @@ + @@ -414,6 +415,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index 95cdb7434c..d800b297e9 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -70,6 +70,9 @@ src\cpp\server + + src\cpp\server + src\cpp\server @@ -162,6 +165,9 @@ include\grpc++\impl + + include\grpc++\impl + include\grpc++\impl diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 22ea361a02..45c0ecd35d 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -270,6 +270,7 @@ + @@ -398,6 +399,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index c3cef2d4df..987d56d6a0 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -55,6 +55,9 @@ src\cpp\server + + src\cpp\server + src\cpp\server @@ -147,6 +150,9 @@ include\grpc++\impl + + include\grpc++\impl + include\grpc++\impl -- cgit v1.2.3 From 12352b2c5c4f1876586fec8148d4b2405d0c7e36 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 10 Jan 2017 15:16:14 -0800 Subject: Add test of server builder, including channel args --- Makefile | 55 +++++ build.yaml | 15 ++ src/cpp/server/server_builder.cc | 8 +- src/cpp/server/server_cc.cc | 2 +- test/cpp/server/server_builder_test.cc | 96 +++++++++ tools/run_tests/generated/sources_and_headers.json | 24 +++ tools/run_tests/generated/tests.json | 22 ++ .../server_builder_test.vcxproj | 223 +++++++++++++++++++++ .../server_builder_test.vcxproj.filters | 39 ++++ 9 files changed, 482 insertions(+), 2 deletions(-) create mode 100644 test/cpp/server/server_builder_test.cc create mode 100644 vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj create mode 100644 vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj.filters (limited to 'tools') diff --git a/Makefile b/Makefile index 9542f17de9..e41f1bee8a 100644 --- a/Makefile +++ b/Makefile @@ -1100,6 +1100,7 @@ round_robin_end2end_test: $(BINDIR)/$(CONFIG)/round_robin_end2end_test secure_auth_context_test: $(BINDIR)/$(CONFIG)/secure_auth_context_test secure_sync_unary_ping_pong_test: $(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test server_builder_plugin_test: $(BINDIR)/$(CONFIG)/server_builder_plugin_test +server_builder_test: $(BINDIR)/$(CONFIG)/server_builder_test server_context_test_spouse_test: $(BINDIR)/$(CONFIG)/server_context_test_spouse_test server_crash_test: $(BINDIR)/$(CONFIG)/server_crash_test server_crash_test_client: $(BINDIR)/$(CONFIG)/server_crash_test_client @@ -1507,6 +1508,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/secure_auth_context_test \ $(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test \ $(BINDIR)/$(CONFIG)/server_builder_plugin_test \ + $(BINDIR)/$(CONFIG)/server_builder_test \ $(BINDIR)/$(CONFIG)/server_context_test_spouse_test \ $(BINDIR)/$(CONFIG)/server_crash_test \ $(BINDIR)/$(CONFIG)/server_crash_test_client \ @@ -1618,6 +1620,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/secure_auth_context_test \ $(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test \ $(BINDIR)/$(CONFIG)/server_builder_plugin_test \ + $(BINDIR)/$(CONFIG)/server_builder_test \ $(BINDIR)/$(CONFIG)/server_context_test_spouse_test \ $(BINDIR)/$(CONFIG)/server_crash_test \ $(BINDIR)/$(CONFIG)/server_crash_test_client \ @@ -1971,6 +1974,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test || ( echo test secure_sync_unary_ping_pong_test failed ; exit 1 ) $(E) "[RUN] Testing server_builder_plugin_test" $(Q) $(BINDIR)/$(CONFIG)/server_builder_plugin_test || ( echo test server_builder_plugin_test failed ; exit 1 ) + $(E) "[RUN] Testing server_builder_test" + $(Q) $(BINDIR)/$(CONFIG)/server_builder_test || ( echo test server_builder_test failed ; exit 1 ) $(E) "[RUN] Testing server_context_test_spouse_test" $(Q) $(BINDIR)/$(CONFIG)/server_context_test_spouse_test || ( echo test server_context_test_spouse_test failed ; exit 1 ) $(E) "[RUN] Testing server_crash_test" @@ -14833,6 +14838,56 @@ endif endif +SERVER_BUILDER_TEST_SRC = \ + $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc \ + test/cpp/server/server_builder_test.cc \ + +SERVER_BUILDER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_BUILDER_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/server_builder_test: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/server_builder_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/server_builder_test: $(PROTOBUF_DEP) $(SERVER_BUILDER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(SERVER_BUILDER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/server_builder_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/echo_messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/echo.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/test/cpp/server/server_builder_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_server_builder_test: $(SERVER_BUILDER_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(SERVER_BUILDER_TEST_OBJS:.o=.dep) +endif +endif +$(OBJDIR)/$(CONFIG)/test/cpp/server/server_builder_test.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc + + SERVER_CONTEXT_TEST_SPOUSE_TEST_SRC = \ test/cpp/test/server_context_test_spouse_test.cc \ diff --git a/build.yaml b/build.yaml index 5d96524f27..e27e301953 100644 --- a/build.yaml +++ b/build.yaml @@ -3810,6 +3810,21 @@ targets: - grpc - gpr_test_util - gpr +- name: server_builder_test + gtest: true + build: test + language: c++ + src: + - src/proto/grpc/testing/echo_messages.proto + - src/proto/grpc/testing/echo.proto + - test/cpp/server/server_builder_test.cc + deps: + - grpc++_test_util + - grpc_test_util + - gpr_test_util + - grpc++ + - grpc + - gpr - name: server_context_test_spouse_test gtest: true build: test diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 00a90bb184..4eb4b5a1b2 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -323,9 +323,14 @@ std::unique_ptr ServerBuilder::BuildAndStart() { } } + bool added_port = false; for (auto port = ports_.begin(); port != ports_.end(); port++) { int r = server->AddListeningPort(port->addr, port->creds.get()); - if (!r) return nullptr; + if (!r) { + if (added_port) server->Shutdown(); + return nullptr; + } + added_port = true; if (port->selected_port != nullptr) { *port->selected_port = r; } @@ -333,6 +338,7 @@ std::unique_ptr ServerBuilder::BuildAndStart() { auto cqs_data = cqs_.empty() ? nullptr : &cqs_[0]; if (!server->Start(cqs_data, cqs_.size())) { + if (added_port) server->Shutdown(); return nullptr; } diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 9e11a8a9e0..e874892e73 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -534,7 +534,7 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { void Server::ShutdownInternal(gpr_timespec deadline) { std::unique_lock lock(mu_); - if (started_ && !shutdown_) { + if (!shutdown_) { shutdown_ = true; /// The completion queue to use for server shutdown completion notification diff --git a/test/cpp/server/server_builder_test.cc b/test/cpp/server/server_builder_test.cc new file mode 100644 index 0000000000..1d9eda17b4 --- /dev/null +++ b/test/cpp/server/server_builder_test.cc @@ -0,0 +1,96 @@ +/* + * + * 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. + * + */ + +#include +#include + +#include +#include + +#include "src/proto/grpc/testing/echo.grpc.pb.h" +#include "test/core/util/port.h" + +namespace grpc { +namespace { + +testing::EchoTestService::Service g_service; + +grpc::string MakePort() { + std::ostringstream s; + int p = grpc_pick_unused_port_or_die(); + s << "localhost:" << p; + return s.str(); +} + +grpc::string g_port = MakePort(); + +TEST(ServerBuilderTest, NoOp) { ServerBuilder b; } + +TEST(ServerBuilderTest, CreateServerNoPorts) { + ServerBuilder().RegisterService(&g_service).BuildAndStart()->Shutdown(); +} + +TEST(ServerBuilderTest, CreateServerOnePort) { + ServerBuilder() + .RegisterService(&g_service) + .AddListeningPort(g_port, InsecureServerCredentials()) + .BuildAndStart() + ->Shutdown(); +} + +TEST(ServerBuilderTest, CreateServerRepeatedPort) { + ServerBuilder() + .RegisterService(&g_service) + .AddListeningPort(g_port, InsecureServerCredentials()) + .AddListeningPort(g_port, InsecureServerCredentials()) + .BuildAndStart() + ->Shutdown(); +} + +TEST(ServerBuilderTest, CreateServerRepeatedPortWithDisallowedReusePort) { + EXPECT_EQ(ServerBuilder() + .RegisterService(&g_service) + .AddListeningPort(g_port, InsecureServerCredentials()) + .AddListeningPort(g_port, InsecureServerCredentials()) + .AddChannelArgument(GRPC_ARG_ALLOW_REUSEPORT, 0) + .BuildAndStart(), + nullptr); +} + +} // namespace +} // namespace grpc + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 99942609dc..866bff8dac 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -3455,6 +3455,30 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", + "grpc++_test_util", + "grpc_test_util" + ], + "headers": [ + "src/proto/grpc/testing/echo.grpc.pb.h", + "src/proto/grpc/testing/echo.pb.h", + "src/proto/grpc/testing/echo_messages.grpc.pb.h", + "src/proto/grpc/testing/echo_messages.pb.h" + ], + "is_filegroup": false, + "language": "c++", + "name": "server_builder_test", + "src": [ + "test/cpp/server/server_builder_test.cc" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index eca65ac533..d7221b1177 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3350,6 +3350,28 @@ "windows" ] }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "server_builder_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, { "args": [], "ci_platforms": [ diff --git a/vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj b/vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj new file mode 100644 index 0000000000..ebbfd59f3d --- /dev/null +++ b/vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj @@ -0,0 +1,223 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {60523734-00BD-765B-5A5B-19E19A2E31B8} + true + $(SolutionDir)IntDir\$(MSBuildProjectName)\ + + + + v100 + + + v110 + + + v120 + + + v140 + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + server_builder_test + static + Debug + static + Debug + + + server_builder_test + static + Release + static + Release + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + {0BE77741-552A-929B-A497-4EF7ECE17A64} + + + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + + + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + + + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + diff --git a/vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj.filters b/vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj.filters new file mode 100644 index 0000000000..c323b7a673 --- /dev/null +++ b/vsprojects/vcxproj/test/server_builder_test/server_builder_test.vcxproj.filters @@ -0,0 +1,39 @@ + + + + + src\proto\grpc\testing + + + src\proto\grpc\testing + + + test\cpp\server + + + + + + {828e0ffc-a89a-de93-ae06-706d522188a1} + + + {538db689-e85f-c369-7020-8d78e0ee5049} + + + {351168ef-9b4f-6165-ff4f-0e13781910db} + + + {530a1a67-0a37-50f8-42d0-7ccf0ec34cfc} + + + {67afe178-6a18-fd24-bbe6-656fee5a5f10} + + + {aaa8777b-1bc3-abaa-5e6d-28040c5aa213} + + + {af770080-f515-c773-3ae0-243d5929bbd0} + + + + -- cgit v1.2.3 From b432885a565cac6cd9510c8ff05ed9eb2cc0458e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 8 Mar 2017 13:08:40 -0800 Subject: Always write index.html --- tools/run_tests/run_microbenchmark.py | 71 ++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-) (limited to 'tools') diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index e735ff8bf9..09f2eb180e 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -228,38 +228,39 @@ argp.add_argument('--summary_time', help='Minimum time to run benchmarks for the summary collection') args = argp.parse_args() -for bm_name in args.benchmarks: - for collect in args.collect: - collectors[collect](bm_name, args) -if args.diff_perf: - if 'summary' not in args.collect: - for bm_name in args.benchmarks: - run_summary(bm_name, 'opt', bm_name) - run_summary(bm_name, 'counters', bm_name) - where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() - subprocess.check_call(['git', 'checkout', args.diff_perf]) - comparables = [] - subprocess.check_call(['make', 'clean']) - try: - for bm_name in args.benchmarks: - try: - run_summary(bm_name, 'opt', '%s.old' % bm_name) - run_summary(bm_name, 'counters', '%s.old' % bm_name) - comparables.append(bm_name) - except subprocess.CalledProcessError, e: - pass - finally: - subprocess.check_call(['git', 'checkout', where_am_i]) - for bm_name in comparables: - diff = subprocess.check_output(['tools/profiling/microbenchmarks/bm_diff.py', - '%s.opt.json' % bm_name, - '%s.counters.json' % bm_name, - '%s.old.opt.json' % bm_name, - '%s.old.counters.json' % bm_name]).strip() - if diff: - heading('Performance diff: %s' % bm_name) - text(diff) - -index_html += "\n\n" -with open('reports/index.html', 'w') as f: - f.write(index_html) +try: + for bm_name in args.benchmarks: + for collect in args.collect: + collectors[collect](bm_name, args) + if args.diff_perf: + if 'summary' not in args.collect: + for bm_name in args.benchmarks: + run_summary(bm_name, 'opt', bm_name) + run_summary(bm_name, 'counters', bm_name) + where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() + subprocess.check_call(['git', 'checkout', args.diff_perf]) + comparables = [] + subprocess.check_call(['make', 'clean']) + try: + for bm_name in args.benchmarks: + try: + run_summary(bm_name, 'opt', '%s.old' % bm_name) + run_summary(bm_name, 'counters', '%s.old' % bm_name) + comparables.append(bm_name) + except subprocess.CalledProcessError, e: + pass + finally: + subprocess.check_call(['git', 'checkout', where_am_i]) + for bm_name in comparables: + diff = subprocess.check_output(['tools/profiling/microbenchmarks/bm_diff.py', + '%s.opt.json' % bm_name, + '%s.counters.json' % bm_name, + '%s.old.opt.json' % bm_name, + '%s.old.counters.json' % bm_name]).strip() + if diff: + heading('Performance diff: %s' % bm_name) + text(diff) +finally: + index_html += "\n\n" + with open('reports/index.html', 'w') as f: + f.write(index_html) -- cgit v1.2.3 From 26995eb2ee277f098ea98f992e8257038f2dd3f8 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 8 Mar 2017 13:10:28 -0800 Subject: Get filename right --- tools/run_tests/run_microbenchmark.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index 09f2eb180e..137e0beb7e 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -178,13 +178,15 @@ def run_summary(bm_name, cfg, base_json_name): def collect_summary(bm_name, args): heading('Summary: %s [no counters]' % bm_name) - text(run_summary(bm_name, 'opt', 'out')) + text(run_summary(bm_name, 'opt', bm_name)) heading('Summary: %s [with counters]' % bm_name) - text(run_summary(bm_name, 'counters', 'out')) + text(run_summary(bm_name, 'counters', bm_name)) if args.bigquery_upload: - with open('out.csv', 'w') as f: - f.write(subprocess.check_output(['tools/profiling/microbenchmarks/bm2bq.py', 'out.counters.json', 'out.opt.json'])) - subprocess.check_call(['bq', 'load', 'microbenchmarks.microbenchmarks', 'out.csv']) + with open('%s.csv' % bm_name, 'w') as f: + f.write(subprocess.check_output(['tools/profiling/microbenchmarks/bm2bq.py', + '%s.counters.json' % bm_name, + '%s.opt.json' % bm_name])) + subprocess.check_call(['bq', 'load', 'microbenchmarks.microbenchmarks', '%s.csv' % bm_name]) collectors = { 'latency': collect_latency, -- cgit v1.2.3 From 5adc93e0ba993b3f43d7982aa738e98f1f777abb Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 8 Mar 2017 13:17:53 -0800 Subject: Add more interesting metrics --- tools/profiling/microbenchmarks/bm_diff.py | 10 +++++++--- tools/run_tests/run_microbenchmark.py | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py index 4dbcc768f7..c9e721369a 100755 --- a/tools/profiling/microbenchmarks/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff.py @@ -25,8 +25,13 @@ def min_change(pct): return lambda n, o: abs((n-o)/o - 1) > pct/100 _INTERESTING = ( - ('cpu_time', min_change(5)), - ('real_time', min_change(5)), + ('cpu_time', min_change(10)), + ('real_time', min_change(10)), + ('locks_per_iteration', min_change(5)), + ('allocs_per_iteration', min_change(5)), + ('writes_per_iteration', min_change(5)), + ('atm_cas_per_iteration', min_change(1)), + ('atm_add_per_iteration', min_change(5)), ) for bm in sorted(new.keys()): @@ -44,4 +49,3 @@ for bm in sorted(new.keys()): hdr = True print ' %s changed %r --> %r' % (fld, o[fld], n[fld]) sys.exit(0) - diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index 137e0beb7e..f41bde113a 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -255,10 +255,10 @@ try: subprocess.check_call(['git', 'checkout', where_am_i]) for bm_name in comparables: diff = subprocess.check_output(['tools/profiling/microbenchmarks/bm_diff.py', - '%s.opt.json' % bm_name, '%s.counters.json' % bm_name, - '%s.old.opt.json' % bm_name, - '%s.old.counters.json' % bm_name]).strip() + '%s.opt.json' % bm_name, + '%s.old.counters.json' % bm_name, + '%s.old.opt.json' % bm_name]).strip() if diff: heading('Performance diff: %s' % bm_name) text(diff) -- cgit v1.2.3 From 47c56a677ee2abe3089fe53a7f81cd0e772491d7 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 8 Mar 2017 13:45:53 -0800 Subject: A better benchmark diff script --- tools/profiling/microbenchmarks/bm_diff.py | 40 +++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py index c9e721369a..5e1f68bc37 100755 --- a/tools/profiling/microbenchmarks/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff.py @@ -3,6 +3,7 @@ import sys import json import bm_json +import tabulate with open(sys.argv[1]) as f: js_new_ctr = json.loads(f.read()) @@ -21,8 +22,11 @@ for row in bm_json.expand_json(js_new_ctr, js_new_opt): for row in bm_json.expand_json(js_old_ctr, js_old_opt): old[row['cpp_name']] = row +def changed_ratio(n, o): + return float(n-o)/float(o) + def min_change(pct): - return lambda n, o: abs((n-o)/o - 1) > pct/100 + return lambda n, o: abs(changed_ratio(n,o)) > pct/100.0 _INTERESTING = ( ('cpu_time', min_change(10)), @@ -34,18 +38,36 @@ _INTERESTING = ( ('atm_add_per_iteration', min_change(5)), ) +changed = [] +for fld, chk in _INTERESTING: + for bm in new.keys(): + if bm not in old: continue + n = new[bm] + o = old[bm] + if fld not in n or fld not in o: continue + if chk(n[fld], o[fld]): + changed.append((fld, chk)) + break + +headers = ['Benchmark'] + [c[0] for c in changed] + ['Details'] +rows = [] for bm in sorted(new.keys()): if bm not in old: continue - hdr = False + row = [bm] + any_changed = False n = new[bm] o = old[bm] - print n - print o + details = '' for fld, chk in _INTERESTING: if fld not in n or fld not in o: continue if chk(n[fld], o[fld]): - if not hdr: - print '%s shows changes:' % bm - hdr = True - print ' %s changed %r --> %r' % (fld, o[fld], n[fld]) - sys.exit(0) + row.append(changed_ratio(n[fld], o[fld])) + if details: details += ', ' + details += '%s:%r-->%r' % (fld, o[fld], n[fld]) + any_changed = True + else: + row.append('') + if any_changed: + row.append(details) + rows.append(row) +print tabulate.tabulate(rows, headers=headers, floatfmt='+.2f') -- cgit v1.2.3 From b97e82b179fa1aeb077cf0575a982866afe17203 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Wed, 8 Mar 2017 14:20:42 -0800 Subject: Change Kokoro scripts to use run_tests_matrix.py --- tools/internal_ci/linux/grpc_master_sanitizers.sh | 10 +--------- tools/internal_ci/linux/grpc_portability.sh | 11 +---------- tools/internal_ci/linux/grpc_portability_build_only.sh | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) (limited to 'tools') diff --git a/tools/internal_ci/linux/grpc_master_sanitizers.sh b/tools/internal_ci/linux/grpc_master_sanitizers.sh index b174c9b174..2cd0efe158 100644 --- a/tools/internal_ci/linux/grpc_master_sanitizers.sh +++ b/tools/internal_ci/linux/grpc_master_sanitizers.sh @@ -37,12 +37,4 @@ git submodule update --init # download docker images from dockerhub export DOCKERHUB_ORGANIZATION=grpctesting -tools/jenkins/run_jenkins_matrix.sh -f sanitizers linux - -# kill port_server.py to prevent the build from hanging -ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9 - -if [ "$FAILED" != "" ] -then - exit 1 -fi +tools/run_tests/run_tests_matrix.sh -f sanitizers linux diff --git a/tools/internal_ci/linux/grpc_portability.sh b/tools/internal_ci/linux/grpc_portability.sh index a7460e5a50..c7ac3bbcbe 100644 --- a/tools/internal_ci/linux/grpc_portability.sh +++ b/tools/internal_ci/linux/grpc_portability.sh @@ -37,13 +37,4 @@ git submodule update --init # download docker images from dockerhub export DOCKERHUB_ORGANIZATION=grpctesting -tools/jenkins/run_jenkins_matrix.sh -f portability linux - -# kill port_server.py to prevent the build from hanging -ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9 - -if [ "$FAILED" != "" ] -then - exit 1 -fi - +tools/run_tests/run_tests_matrix.sh -f portability linux diff --git a/tools/internal_ci/linux/grpc_portability_build_only.sh b/tools/internal_ci/linux/grpc_portability_build_only.sh index 92678c15f8..edd6f91687 100644 --- a/tools/internal_ci/linux/grpc_portability_build_only.sh +++ b/tools/internal_ci/linux/grpc_portability_build_only.sh @@ -37,4 +37,4 @@ git submodule update --init # download docker images from dockerhub export DOCKERHUB_ORGANIZATION=grpctesting -tools/jenkins/run_jenkins_matrix.sh -f portability linux --build_only +tools/run_tests/run_tests_matrix.sh -f portability linux --build_only -- cgit v1.2.3 From f90d4c837283f86cc812c7ea39afb89ed64521c7 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 9 Mar 2017 16:35:21 -0800 Subject: Add copyright and license to bm_diff.py --- tools/profiling/microbenchmarks/bm_diff.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tools') diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py index 5e1f68bc37..59cc2d0e47 100755 --- a/tools/profiling/microbenchmarks/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff.py @@ -1,4 +1,32 @@ #!/usr/bin/env python2.7 +# 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 -- cgit v1.2.3