diff options
Diffstat (limited to 'tools')
10 files changed, 78 insertions, 15 deletions
diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py index e7893a1fd5..66acc733e5 100755 --- a/tools/distrib/check_copyright.py +++ b/tools/distrib/check_copyright.py @@ -93,8 +93,9 @@ _EXEMPT = frozenset(( # status.proto copied from googleapis 'src/proto/grpc/status/status.proto', - # Gradle wrapper used to build for Android + # Gradle wrappers used to build for Android 'examples/android/helloworld/gradlew.bat', + 'src/android/test/interop/gradlew.bat', )) RE_YEAR = r'Copyright (?P<first_year>[0-9]+\-)?(?P<last_year>[0-9]+) gRPC authors.' diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh index 08c6a96f71..3b901ae4bf 100755 --- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh +++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh @@ -16,10 +16,10 @@ set -e # directories to run against -DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/csharp src/ruby third_party/address_sorting" +DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/csharp src/ruby third_party/address_sorting src/objective-c" # file matching patterns to check -GLOB="*.h *.c *.cc" +GLOB="*.h *.c *.cc *.m *.mm" # clang format command CLANG_FORMAT=${CLANG_FORMAT:-clang-format-5.0} @@ -29,7 +29,7 @@ for dir in $DIRS do for glob in $GLOB do - files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name '*.generated.*' -and -not -name '*.pb.h' -and -not -name '*.pb.c' -and -not -name '*.pb.cc' -and -not -name end2end_tests.cc -and -not -name end2end_nosec_tests.cc -and -not -name public_headers_must_be_c89.c`" + files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name '*.generated.*' -and -not -name '*.pb.h' -and -not -name '*.pb.c' -and -not -name '*.pb.cc' -and -not -name '*.pbobjc.h' -and -not -name '*.pbobjc.m' -and -not -name '*.pbrpc.h' -and -not -name '*.pbrpc.m' -and -not -name end2end_tests.cc -and -not -name end2end_nosec_tests.cc -and -not -name public_headers_must_be_c89.c`" done done diff --git a/tools/internal_ci/linux/grpc_android.sh b/tools/internal_ci/linux/grpc_android.sh index c693b772fd..2220145dac 100755 --- a/tools/internal_ci/linux/grpc_android.sh +++ b/tools/internal_ci/linux/grpc_android.sh @@ -31,7 +31,32 @@ cd third_party/protobuf git fetch git cherry-pick 7daa320065f3bea2b54bf983337d1724f153422d -m 1 -cd ../../examples/android/helloworld + +# Build and run interop instrumentation tests on Firebase Test Lab + +cd "${REPO_ROOT}/src/android/test/interop/" +./gradlew assembleDebug \ + "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ + "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" +./gradlew assembleDebugAndroidTest \ + "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ + "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" +gcloud firebase test android run \ + --type instrumentation \ + --app app/build/outputs/apk/debug/app-debug.apk \ + --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \ + --device model=Nexus6P,version=27,locale=en,orientation=portrait \ + --device model=Nexus6P,version=26,locale=en,orientation=portrait \ + --device model=Nexus6P,version=25,locale=en,orientation=portrait \ + --device model=Nexus6P,version=24,locale=en,orientation=portrait \ + --device model=Nexus6P,version=23,locale=en,orientation=portrait \ + --device model=Nexus6,version=22,locale=en,orientation=portrait \ + --device model=Nexus6,version=21,locale=en,orientation=portrait + + +# Build hello world example + +cd "${REPO_ROOT}/examples/android/helloworld" ./gradlew build \ "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh index 3ff569df47..ed5caa4023 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600" +EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=2" github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh index ded0d368a5..66f02a82ff 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600" +EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=2" github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh b/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh new file mode 100644 index 0000000000..3ff569df47 --- /dev/null +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600" +github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" + diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh b/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh new file mode 100644 index 0000000000..ded0d368a5 --- /dev/null +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600" +github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py index e084e28dcf..c5307c52bd 100755 --- a/tools/profiling/microbenchmarks/bm2bq.py +++ b/tools/profiling/microbenchmarks/bm2bq.py @@ -1,9 +1,5 @@ #!/usr/bin/env python2.7 # -# Convert google-benchmark json output to something that can be uploaded to -# BigQuery -# -# # Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Convert google-benchmark json output to something that can be uploaded to +# BigQuery + import sys import json import csv @@ -54,6 +53,7 @@ if len(sys.argv) > 2: else: js2 = None +# TODO(jtattermusch): write directly to a file instead of stdout writer = csv.DictWriter(sys.stdout, [c for c, t in columns]) for row in bm_json.expand_json(js, js2): diff --git a/tools/profiling/microbenchmarks/bm_json.py b/tools/profiling/microbenchmarks/bm_json.py index 497d7ca813..2f5eb708de 100644 --- a/tools/profiling/microbenchmarks/bm_json.py +++ b/tools/profiling/microbenchmarks/bm_json.py @@ -12,8 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Utilities for manipulating JSON data that represents microbenchmark results. + import os +# template arguments and dynamic arguments of individual benchmark types +# Example benchmark name: "BM_UnaryPingPong<TCP, NoOpMutator, NoOpMutator>/0/0" _BM_SPECS = { 'BM_UnaryPingPong': { 'tpl': ['fixture', 'client_mutator', 'server_mutator'], @@ -115,6 +119,7 @@ _BM_SPECS = { def numericalize(s): + """Convert abbreviations like '100M' or '10k' to a number.""" if not s: return '' if s[-1] == 'k': return float(s[:-1]) * 1024 @@ -159,9 +164,6 @@ def parse_name(name): rest = s[0] dyn_args = s[1:] name = rest - print(name) - print(dyn_args, _BM_SPECS[name]['dyn']) - print(tpl_args, _BM_SPECS[name]['tpl']) 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']) diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 1b467edbc5..9087841c4b 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -164,7 +164,7 @@ class PythonDistribTest(object): self.name, 'tools/dockerfile/distribtest/python_%s_%s' % (self.docker_suffix, self.arch), - 'test/distrib/python/run_distrib_test.sh', + 'test/distrib/python/run_binary_distrib_test.sh', copy_rel_path='test/distrib') def __str__(self): |