diff options
Diffstat (limited to 'tools')
36 files changed, 664 insertions, 295 deletions
diff --git a/tools/distrib/build_ruby_environment_macos.sh b/tools/distrib/build_ruby_environment_macos.sh index af36740255..4a388a0e5c 100644 --- a/tools/distrib/build_ruby_environment_macos.sh +++ b/tools/distrib/build_ruby_environment_macos.sh @@ -17,12 +17,12 @@ set -ex rm -rf ~/.rake-compiler -CROSS_RUBY=`mktemp tmpfile.XXXXXXXX` +CROSS_RUBY=$(mktemp tmpfile.XXXXXXXX) -curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.0.3/tasks/bin/cross-ruby.rake > $CROSS_RUBY +curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.0.3/tasks/bin/cross-ruby.rake > "$CROSS_RUBY" # See https://github.com/grpc/grpc/issues/12161 for verconf.h patch details -patch $CROSS_RUBY << EOF +patch "$CROSS_RUBY" << EOF --- cross-ruby.rake 2017-09-27 16:46:00.311020325 +0200 +++ patched 2017-09-27 16:49:46.127016895 +0200 @@ -133,7 +133,8 @@ @@ -49,8 +49,9 @@ MAKE="make -j8" for v in 2.5.0 2.4.0 2.3.0 2.2.2 2.1.6 2.0.0-p645 ; do ccache -c - rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11 + rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE" done -sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > $CROSS_RUBY -mv $CROSS_RUBY ~/.rake-compiler/config.yml +sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > "$CROSS_RUBY" +mv "$CROSS_RUBY" ~/.rake-compiler/config.yml + diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh index 81a04cbf57..a30b73f689 100755 --- a/tools/distrib/check_nanopb_output.sh +++ b/tools/distrib/check_nanopb_output.sh @@ -51,7 +51,7 @@ readonly LOAD_BALANCER_GRPC_OUTPUT_PATH='src/core/ext/filters/client_channel/lb_ "$LOAD_BALANCER_GRPC_OUTPUT_PATH" # compare outputs to checked compiled code -if ! diff -r $NANOPB_TMP_OUTPUT src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1; then +if ! diff -r "$NANOPB_TMP_OUTPUT" src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1; then echo "Outputs differ: $NANOPB_TMP_OUTPUT vs $LOAD_BALANCER_GRPC_OUTPUT_PATH" exit 2 fi diff --git a/tools/distrib/check_windows_dlls.sh b/tools/distrib/check_windows_dlls.sh index 9b03e8bf3e..c25091edfd 100755 --- a/tools/distrib/check_windows_dlls.sh +++ b/tools/distrib/check_windows_dlls.sh @@ -16,7 +16,7 @@ set -ex # change to root directory -cd $(dirname $0)/../.. +cd "$(dirname "$0")/../.." bundle rake dlls diff --git a/tools/distrib/clang_tidy_code.sh b/tools/distrib/clang_tidy_code.sh new file mode 100755 index 0000000000..5da86aa277 --- /dev/null +++ b/tools/distrib/clang_tidy_code.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2015 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. + +echo "NOTE: to automagically apply fixes, invoke with --fix" + +set -ex + +# change to root directory +cd $(dirname $0)/../.. +REPO_ROOT=$(pwd) + +if [ "$CLANG_TIDY_SKIP_DOCKER" == "" ] +then + # build clang-tidy docker image + docker build -t grpc_clang_tidy tools/dockerfile/grpc_clang_tidy + + # run clang-tidy against the checked out codebase + docker run -e TEST=$TEST -e CHANGED_FILES="$CHANGED_FILES" -e CLANG_TIDY_ROOT="/local-code" --rm=true -v "${REPO_ROOT}":/local-code -t grpc_clang_tidy /clang_tidy_all_the_things.sh "$@" +else + CLANG_TIDY_ROOT="${REPO_ROOT}" tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh "$@" +fi diff --git a/tools/distrib/run_clang_tidy.py b/tools/distrib/run_clang_tidy.py index 72d7956b68..bc61d4e79a 100755 --- a/tools/distrib/run_clang_tidy.py +++ b/tools/distrib/run_clang_tidy.py @@ -69,4 +69,5 @@ for filename in args.files: shortname=filename, )) #verbose_success=True)) -jobset.run(jobs, maxjobs=args.jobs) +num_fails, res_set = jobset.run(jobs, maxjobs=args.jobs) +sys.exit(num_fails) diff --git a/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_0_0/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_0_0/Dockerfile new file mode 100644 index 0000000000..ff43c92c9e --- /dev/null +++ b/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_0_0/Dockerfile @@ -0,0 +1,40 @@ +# Copyright 2015 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. + +FROM debian:jessie + +# Install Git and basic packages. +RUN apt-get update && apt-get install -y \ + curl \ + gcc && apt-get clean + +#================== +# Ruby dependencies + +# Install rvm +RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +RUN \curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby 2.1 +RUN /bin/bash -l -c "rvm install ruby-2.0" +RUN /bin/bash -l -c "rvm use --default ruby-2.0" +RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" +RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" +RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.0' >> ~/.bashrc" +RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" + +RUN mkdir /var/local/jenkins + +# Define the default command. +CMD ["bash"] diff --git a/tools/dockerfile/grpc_clang_format/Dockerfile b/tools/dockerfile/grpc_clang_format/Dockerfile index b3abaef465..8801315bc9 100644 --- a/tools/dockerfile/grpc_clang_format/Dockerfile +++ b/tools/dockerfile/grpc_clang_format/Dockerfile @@ -19,6 +19,8 @@ RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.0 RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format ENV CLANG_FORMAT=clang-format +RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-tidy /usr/local/bin/clang-tidy +ENV CLANG_TIDY=clang-tidy ADD clang_format_all_the_things.sh / CMD ["echo 'Run with tools/distrib/clang_format_code.sh'"] diff --git a/tools/dockerfile/grpc_clang_tidy/Dockerfile b/tools/dockerfile/grpc_clang_tidy/Dockerfile new file mode 100644 index 0000000000..9d9d70185b --- /dev/null +++ b/tools/dockerfile/grpc_clang_tidy/Dockerfile @@ -0,0 +1,41 @@ +# Copyright 2015 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. + +FROM debian:jessie + +RUN apt-get update && apt-get -y install wget xz-utils +RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz +RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz +RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format +ENV CLANG_FORMAT=clang-format +RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-tidy /usr/local/bin/clang-tidy +ENV CLANG_TIDY=clang-tidy + +#==================== +# Python dependencies + +# Install dependencies + +RUN apt-get update && apt-get install -y \ + python-all-dev \ + python3-all-dev \ + python-pip + +# Install Python packages from PyPI +RUN pip install --upgrade pip==9.0.1 +RUN pip install virtualenv +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 + +ADD clang_tidy_all_the_things.sh / +CMD ["echo 'Run with tools/distrib/clang_tidy_code.sh'"] diff --git a/tools/run_tests/sanity/check_clang_tidy.sh b/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh index 6c4caa1ee6..1a82dd52b7 100755 --- a/tools/run_tests/sanity/check_clang_tidy.sh +++ b/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh @@ -13,9 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -e +set -ex -make buildtests \ - -j "$(python -c 'import multiprocessing; print multiprocessing.cpu_count()')" -find src/core src/cpp test/core test/cpp -print0 -name '*.h' -or -name '*.cc' \ +# clang format command +CLANG_TIDY=${CLANG_TIDY:-clang-tidy-5.0} + +cd ${CLANG_TIDY_ROOT} + +find src/core src/cpp test/core test/cpp -name '*.h' -or -name '*.cc' -print0 \ | xargs -0 tools/distrib/run_clang_tidy.py "$@" diff --git a/tools/dockerfile/push_testing_images.sh b/tools/dockerfile/push_testing_images.sh index e9151303f7..b76ceea8f6 100755 --- a/tools/dockerfile/push_testing_images.sh +++ b/tools/dockerfile/push_testing_images.sh @@ -29,7 +29,7 @@ cd - DOCKERHUB_ORGANIZATION=grpctesting -for DOCKERFILE_DIR in tools/dockerfile/test/* tools/dockerfile/grpc_artifact_* tools/dockerfile/interoptest/* third_party/rake-compiler-dock +for DOCKERFILE_DIR in tools/dockerfile/test/* tools/dockerfile/grpc_artifact_* tools/dockerfile/interoptest/* tools/dockerfile/distribtest/cpp_jessie_x64 third_party/rake-compiler-dock do # Generate image name based on Dockerfile checksum. That works well as long # as can count on dockerfiles being written in a way that changing the logical diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index 6e5a133a69..7a8e1c09b1 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -110,6 +110,8 @@ RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.0 RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format ENV CLANG_FORMAT=clang-format +RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-tidy /usr/local/bin/clang-tidy +ENV CLANG_TIDY=clang-tidy # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index d9184f49a2..55b10268ba 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -950,6 +950,28 @@ src/core/lib/compression/stream_compression_identity.h \ src/core/lib/debug/stats.h \ src/core/lib/debug/stats_data.h \ src/core/lib/debug/trace.h \ +src/core/lib/gpr++/abstract.h \ +src/core/lib/gpr++/atomic.h \ +src/core/lib/gpr++/atomic_with_atm.h \ +src/core/lib/gpr++/atomic_with_std.h \ +src/core/lib/gpr++/debug_location.h \ +src/core/lib/gpr++/inlined_vector.h \ +src/core/lib/gpr++/manual_constructor.h \ +src/core/lib/gpr++/memory.h \ +src/core/lib/gpr++/orphanable.h \ +src/core/lib/gpr++/ref_counted.h \ +src/core/lib/gpr++/ref_counted_ptr.h \ +src/core/lib/gpr/arena.h \ +src/core/lib/gpr/env.h \ +src/core/lib/gpr/fork.h \ +src/core/lib/gpr/mpscq.h \ +src/core/lib/gpr/murmur_hash.h \ +src/core/lib/gpr/spinlock.h \ +src/core/lib/gpr/string.h \ +src/core/lib/gpr/string_windows.h \ +src/core/lib/gpr/thd_internal.h \ +src/core/lib/gpr/time_precise.h \ +src/core/lib/gpr/tmpfile.h \ src/core/lib/http/format_request.h \ src/core/lib/http/httpcli.h \ src/core/lib/http/parser.h \ @@ -1026,27 +1048,6 @@ src/core/lib/slice/percent_encoding.h \ src/core/lib/slice/slice_hash_table.h \ src/core/lib/slice/slice_internal.h \ src/core/lib/slice/slice_string_helpers.h \ -src/core/lib/support/abstract.h \ -src/core/lib/support/arena.h \ -src/core/lib/support/atomic.h \ -src/core/lib/support/atomic_with_atm.h \ -src/core/lib/support/atomic_with_std.h \ -src/core/lib/support/debug_location.h \ -src/core/lib/support/env.h \ -src/core/lib/support/fork.h \ -src/core/lib/support/manual_constructor.h \ -src/core/lib/support/memory.h \ -src/core/lib/support/mpscq.h \ -src/core/lib/support/murmur_hash.h \ -src/core/lib/support/ref_counted.h \ -src/core/lib/support/ref_counted_ptr.h \ -src/core/lib/support/spinlock.h \ -src/core/lib/support/string.h \ -src/core/lib/support/string_windows.h \ -src/core/lib/support/thd_internal.h \ -src/core/lib/support/time_precise.h \ -src/core/lib/support/tmpfile.h \ -src/core/lib/support/vector.h \ src/core/lib/surface/alarm_internal.h \ src/core/lib/surface/api_trace.h \ src/core/lib/surface/call.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 3d3c6711d0..7857ec72fd 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1064,6 +1064,72 @@ src/core/lib/debug/stats_data.cc \ src/core/lib/debug/stats_data.h \ src/core/lib/debug/trace.cc \ src/core/lib/debug/trace.h \ +src/core/lib/gpr++/README.md \ +src/core/lib/gpr++/abstract.h \ +src/core/lib/gpr++/atomic.h \ +src/core/lib/gpr++/atomic_with_atm.h \ +src/core/lib/gpr++/atomic_with_std.h \ +src/core/lib/gpr++/debug_location.h \ +src/core/lib/gpr++/inlined_vector.h \ +src/core/lib/gpr++/manual_constructor.h \ +src/core/lib/gpr++/memory.h \ +src/core/lib/gpr++/orphanable.h \ +src/core/lib/gpr++/ref_counted.h \ +src/core/lib/gpr++/ref_counted_ptr.h \ +src/core/lib/gpr/README.md \ +src/core/lib/gpr/alloc.cc \ +src/core/lib/gpr/arena.cc \ +src/core/lib/gpr/arena.h \ +src/core/lib/gpr/atm.cc \ +src/core/lib/gpr/avl.cc \ +src/core/lib/gpr/cmdline.cc \ +src/core/lib/gpr/cpu_iphone.cc \ +src/core/lib/gpr/cpu_linux.cc \ +src/core/lib/gpr/cpu_posix.cc \ +src/core/lib/gpr/cpu_windows.cc \ +src/core/lib/gpr/env.h \ +src/core/lib/gpr/env_linux.cc \ +src/core/lib/gpr/env_posix.cc \ +src/core/lib/gpr/env_windows.cc \ +src/core/lib/gpr/fork.cc \ +src/core/lib/gpr/fork.h \ +src/core/lib/gpr/host_port.cc \ +src/core/lib/gpr/log.cc \ +src/core/lib/gpr/log_android.cc \ +src/core/lib/gpr/log_linux.cc \ +src/core/lib/gpr/log_posix.cc \ +src/core/lib/gpr/log_windows.cc \ +src/core/lib/gpr/mpscq.cc \ +src/core/lib/gpr/mpscq.h \ +src/core/lib/gpr/murmur_hash.cc \ +src/core/lib/gpr/murmur_hash.h \ +src/core/lib/gpr/spinlock.h \ +src/core/lib/gpr/string.cc \ +src/core/lib/gpr/string.h \ +src/core/lib/gpr/string_posix.cc \ +src/core/lib/gpr/string_util_windows.cc \ +src/core/lib/gpr/string_windows.cc \ +src/core/lib/gpr/string_windows.h \ +src/core/lib/gpr/subprocess_posix.cc \ +src/core/lib/gpr/subprocess_windows.cc \ +src/core/lib/gpr/sync.cc \ +src/core/lib/gpr/sync_posix.cc \ +src/core/lib/gpr/sync_windows.cc \ +src/core/lib/gpr/thd.cc \ +src/core/lib/gpr/thd_internal.h \ +src/core/lib/gpr/thd_posix.cc \ +src/core/lib/gpr/thd_windows.cc \ +src/core/lib/gpr/time.cc \ +src/core/lib/gpr/time_posix.cc \ +src/core/lib/gpr/time_precise.cc \ +src/core/lib/gpr/time_precise.h \ +src/core/lib/gpr/time_windows.cc \ +src/core/lib/gpr/tls_pthread.cc \ +src/core/lib/gpr/tmpfile.h \ +src/core/lib/gpr/tmpfile_msys.cc \ +src/core/lib/gpr/tmpfile_posix.cc \ +src/core/lib/gpr/tmpfile_windows.cc \ +src/core/lib/gpr/wrap_memcpy.cc \ src/core/lib/http/format_request.cc \ src/core/lib/http/format_request.h \ src/core/lib/http/httpcli.cc \ @@ -1271,69 +1337,6 @@ src/core/lib/slice/slice_intern.cc \ src/core/lib/slice/slice_internal.h \ src/core/lib/slice/slice_string_helpers.cc \ src/core/lib/slice/slice_string_helpers.h \ -src/core/lib/support/abstract.h \ -src/core/lib/support/alloc.cc \ -src/core/lib/support/arena.cc \ -src/core/lib/support/arena.h \ -src/core/lib/support/atm.cc \ -src/core/lib/support/atomic.h \ -src/core/lib/support/atomic_with_atm.h \ -src/core/lib/support/atomic_with_std.h \ -src/core/lib/support/avl.cc \ -src/core/lib/support/cmdline.cc \ -src/core/lib/support/cpu_iphone.cc \ -src/core/lib/support/cpu_linux.cc \ -src/core/lib/support/cpu_posix.cc \ -src/core/lib/support/cpu_windows.cc \ -src/core/lib/support/debug_location.h \ -src/core/lib/support/env.h \ -src/core/lib/support/env_linux.cc \ -src/core/lib/support/env_posix.cc \ -src/core/lib/support/env_windows.cc \ -src/core/lib/support/fork.cc \ -src/core/lib/support/fork.h \ -src/core/lib/support/host_port.cc \ -src/core/lib/support/log.cc \ -src/core/lib/support/log_android.cc \ -src/core/lib/support/log_linux.cc \ -src/core/lib/support/log_posix.cc \ -src/core/lib/support/log_windows.cc \ -src/core/lib/support/manual_constructor.h \ -src/core/lib/support/memory.h \ -src/core/lib/support/mpscq.cc \ -src/core/lib/support/mpscq.h \ -src/core/lib/support/murmur_hash.cc \ -src/core/lib/support/murmur_hash.h \ -src/core/lib/support/ref_counted.h \ -src/core/lib/support/ref_counted_ptr.h \ -src/core/lib/support/spinlock.h \ -src/core/lib/support/string.cc \ -src/core/lib/support/string.h \ -src/core/lib/support/string_posix.cc \ -src/core/lib/support/string_util_windows.cc \ -src/core/lib/support/string_windows.cc \ -src/core/lib/support/string_windows.h \ -src/core/lib/support/subprocess_posix.cc \ -src/core/lib/support/subprocess_windows.cc \ -src/core/lib/support/sync.cc \ -src/core/lib/support/sync_posix.cc \ -src/core/lib/support/sync_windows.cc \ -src/core/lib/support/thd.cc \ -src/core/lib/support/thd_internal.h \ -src/core/lib/support/thd_posix.cc \ -src/core/lib/support/thd_windows.cc \ -src/core/lib/support/time.cc \ -src/core/lib/support/time_posix.cc \ -src/core/lib/support/time_precise.cc \ -src/core/lib/support/time_precise.h \ -src/core/lib/support/time_windows.cc \ -src/core/lib/support/tls_pthread.cc \ -src/core/lib/support/tmpfile.h \ -src/core/lib/support/tmpfile_msys.cc \ -src/core/lib/support/tmpfile_posix.cc \ -src/core/lib/support/tmpfile_windows.cc \ -src/core/lib/support/vector.h \ -src/core/lib/support/wrap_memcpy.cc \ src/core/lib/surface/README.md \ src/core/lib/surface/alarm.cc \ src/core/lib/surface/alarm_internal.h \ diff --git a/tools/internal_ci/linux/grpc_distribtests_standalone.cfg b/tools/internal_ci/linux/grpc_distribtests_standalone.cfg new file mode 100644 index 0000000000..bc6c8e8f80 --- /dev/null +++ b/tools/internal_ci/linux/grpc_distribtests_standalone.cfg @@ -0,0 +1,26 @@ +# 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. + +# 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_distribtests_standalone.sh" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "github/grpc/reports/**" + regex: "github/grpc/artifacts/**" + } +} diff --git a/tools/internal_ci/linux/grpc_distribtests_standalone.sh b/tools/internal_ci/linux/grpc_distribtests_standalone.sh new file mode 100755 index 0000000000..084daa9bc6 --- /dev/null +++ b/tools/internal_ci/linux/grpc_distribtests_standalone.sh @@ -0,0 +1,23 @@ +#!/bin/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. + +set -ex + +# change to grpc repo root +cd $(dirname $0)/../../.. + +source tools/internal_ci/helper_scripts/prepare_build_linux_rc + +tools/run_tests/task_runner.py -f distribtest linux cpp -j 6 diff --git a/tools/internal_ci/linux/grpc_interop_toprod.cfg b/tools/internal_ci/linux/grpc_interop_toprod.cfg index 8d025c4f60..ff7a98f44e 100644 --- a/tools/internal_ci/linux/grpc_interop_toprod.cfg +++ b/tools/internal_ci/linux/grpc_interop_toprod.cfg @@ -26,5 +26,5 @@ action { env_vars { key: "RUN_TESTS_FLAGS" - value: "-l all --cloud_to_prod --cloud_to_prod_auth --prod_servers default gateway_v4 --use_docker --internal_ci -t -j 12 --bq_result_table interop_results" + value: "-l all --cloud_to_prod --cloud_to_prod_auth --prod_servers default gateway_v4 cloud_gateway cloud_gateway_v4 --use_docker --internal_ci -t -j 12 --bq_result_table interop_results" } diff --git a/tools/internal_ci/windows/grpc_distribtests_standalone.bat b/tools/internal_ci/windows/grpc_distribtests_standalone.bat new file mode 100644 index 0000000000..3eb33b1548 --- /dev/null +++ b/tools/internal_ci/windows/grpc_distribtests_standalone.bat @@ -0,0 +1,31 @@ +@rem Copyright 2017 gRPC authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder +@rem TODO(jtattermusch): get rid of this hack +rename C:\Python27_32bit Python27_32bits +rename C:\Python34_32bit Python34_32bits +rename C:\Python35_32bit Python35_32bits +rename C:\Python36_32bit Python36_32bits + +@rem enter repo root +cd /d %~dp0\..\..\.. + +call tools/internal_ci/helper_scripts/prepare_build_windows.bat + +python tools/run_tests/task_runner.py -f distribtest windows cpp -j 4 || goto :error +goto :EOF + +:error +exit /b %errorlevel% diff --git a/tools/internal_ci/windows/grpc_distribtests_standalone.cfg b/tools/internal_ci/windows/grpc_distribtests_standalone.cfg new file mode 100644 index 0000000000..33a50fdc45 --- /dev/null +++ b/tools/internal_ci/windows/grpc_distribtests_standalone.cfg @@ -0,0 +1,26 @@ +# 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. + +# 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_distribtests_standalone.bat" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "github/grpc/reports/**" + regex: "github/grpc/artifacts/**" + } +} diff --git a/tools/run_tests/artifacts/build_artifact_csharp.sh b/tools/run_tests/artifacts/build_artifact_csharp.sh index 0884a9e5d6..d65340261d 100755 --- a/tools/run_tests/artifacts/build_artifact_csharp.sh +++ b/tools/run_tests/artifacts/build_artifact_csharp.sh @@ -15,7 +15,7 @@ set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." make grpc_csharp_ext diff --git a/tools/run_tests/artifacts/build_artifact_php.sh b/tools/run_tests/artifacts/build_artifact_php.sh index bfba956f05..9372dc9b6b 100755 --- a/tools/run_tests/artifacts/build_artifact_php.sh +++ b/tools/run_tests/artifacts/build_artifact_php.sh @@ -13,10 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -PHP_TARGET_ARCH=$1 set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." mkdir -p "${ARTIFACTS_OUT}" diff --git a/tools/run_tests/artifacts/build_artifact_protoc.sh b/tools/run_tests/artifacts/build_artifact_protoc.sh index 5c5ab7d78f..b531fc9a5d 100755 --- a/tools/run_tests/artifacts/build_artifact_protoc.sh +++ b/tools/run_tests/artifacts/build_artifact_protoc.sh @@ -18,7 +18,7 @@ source scl_source enable devtoolset-1.1 set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." make plugins diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index ab5bce04f9..10d8211e23 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -15,7 +15,7 @@ set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." export GRPC_PYTHON_USE_CUSTOM_BDIST=0 export GRPC_PYTHON_BUILD_WITH_CYTHON=1 @@ -29,30 +29,30 @@ ARTIFACT_DIR="$PWD/${ARTIFACTS_OUT}" # Build the source distribution first because MANIFEST.in cannot override # exclusion of built shared objects among package resources (for some # inexplicable reason). -${SETARCH_CMD} ${PYTHON} setup.py sdist +${SETARCH_CMD} "${PYTHON}" setup.py sdist # Wheel has a bug where directories don't get excluded. # https://bitbucket.org/pypa/wheel/issues/99/cannot-exclude-directory -${SETARCH_CMD} ${PYTHON} setup.py bdist_wheel +${SETARCH_CMD} "${PYTHON}" setup.py bdist_wheel # Build gRPC tools package distribution -${PYTHON} tools/distrib/python/make_grpcio_tools.py +"${PYTHON}" tools/distrib/python/make_grpcio_tools.py # Build gRPC tools package source distribution -${SETARCH_CMD} ${PYTHON} tools/distrib/python/grpcio_tools/setup.py sdist +${SETARCH_CMD} "${PYTHON}" tools/distrib/python/grpcio_tools/setup.py sdist # Build gRPC tools package binary distribution -${SETARCH_CMD} ${PYTHON} tools/distrib/python/grpcio_tools/setup.py bdist_wheel +${SETARCH_CMD} "${PYTHON}" tools/distrib/python/grpcio_tools/setup.py bdist_wheel if [ "$GRPC_BUILD_MANYLINUX_WHEEL" != "" ] then for wheel in dist/*.whl; do - ${AUDITWHEEL} repair $wheel -w "$ARTIFACT_DIR" - rm $wheel + "${AUDITWHEEL}" repair "$wheel" -w "$ARTIFACT_DIR" + rm "$wheel" done for wheel in tools/distrib/python/grpcio_tools/dist/*.whl; do - ${AUDITWHEEL} repair $wheel -w "$ARTIFACT_DIR" - rm $wheel + "${AUDITWHEEL}" repair "$wheel" -w "$ARTIFACT_DIR" + rm "$wheel" done fi @@ -62,17 +62,17 @@ fi # are in a docker image or in a virtualenv. if [ "$GRPC_BUILD_GRPCIO_TOOLS_DEPENDENTS" != "" ] then - ${PIP} install -rrequirements.txt - ${PIP} install grpcio --no-index --find-links "file://$ARTIFACT_DIR/" - ${PIP} install grpcio-tools --no-index --find-links "file://$ARTIFACT_DIR/" + "${PIP}" install -rrequirements.txt + "${PIP}" install grpcio --no-index --find-links "file://$ARTIFACT_DIR/" + "${PIP}" install grpcio-tools --no-index --find-links "file://$ARTIFACT_DIR/" # Build gRPC health-checking source distribution - ${SETARCH_CMD} ${PYTHON} src/python/grpcio_health_checking/setup.py \ + ${SETARCH_CMD} "${PYTHON}" src/python/grpcio_health_checking/setup.py \ preprocess build_package_protos sdist cp -r src/python/grpcio_health_checking/dist/* "$ARTIFACT_DIR" # Build gRPC reflection source distribution - ${SETARCH_CMD} ${PYTHON} src/python/grpcio_reflection/setup.py \ + ${SETARCH_CMD} "${PYTHON}" src/python/grpcio_reflection/setup.py \ preprocess build_package_protos sdist cp -r src/python/grpcio_reflection/dist/* "$ARTIFACT_DIR" fi diff --git a/tools/run_tests/artifacts/build_artifact_ruby.sh b/tools/run_tests/artifacts/build_artifact_ruby.sh index 9165a22484..5ab4cf21b4 100755 --- a/tools/run_tests/artifacts/build_artifact_ruby.sh +++ b/tools/run_tests/artifacts/build_artifact_ruby.sh @@ -14,9 +14,9 @@ # limitations under the License. set -ex -SYSTEM=`uname | cut -f 1 -d_` +SYSTEM=$(uname | cut -f 1 -d_) -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." set +ex [[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" @@ -46,7 +46,9 @@ export DOCKERHUB_ORGANIZATION=grpctesting rake gem:native if [ "$SYSTEM" == "Darwin" ] ; then - rm `ls pkg/*.gem | grep -v darwin` + # TODO: consider rewriting this to pass shellcheck + # shellcheck disable=SC2046,SC2010 + rm $(ls pkg/*.gem | grep -v darwin) fi mkdir -p "${ARTIFACTS_OUT}" diff --git a/tools/run_tests/artifacts/build_package_php.sh b/tools/run_tests/artifacts/build_package_php.sh index d2d1e8d459..85e4dda40a 100755 --- a/tools/run_tests/artifacts/build_package_php.sh +++ b/tools/run_tests/artifacts/build_package_php.sh @@ -15,7 +15,7 @@ set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." mkdir -p artifacts/ -cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/php_*/* artifacts/ || true +cp -r "$EXTERNAL_GIT_ROOT"/platform={windows,linux,macos}/artifacts/php_*/* artifacts/ || true diff --git a/tools/run_tests/artifacts/build_package_python.sh b/tools/run_tests/artifacts/build_package_python.sh index 1d9d04e3c0..d596e35000 100755 --- a/tools/run_tests/artifacts/build_package_python.sh +++ b/tools/run_tests/artifacts/build_package_python.sh @@ -15,13 +15,13 @@ set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." mkdir -p artifacts/ # All the python packages have been built in the artifact phase already # and we only collect them here to deliver them to the distribtest phase. -cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/python_*/* artifacts/ || true +cp -r "$EXTERNAL_GIT_ROOT"/platform={windows,linux,macos}/artifacts/python_*/* artifacts/ || true # TODO: all the artifact builder configurations generate a grpcio-VERSION.tar.gz # source distribution package, and only one of them will end up diff --git a/tools/run_tests/artifacts/build_package_ruby.sh b/tools/run_tests/artifacts/build_package_ruby.sh index b7e0965ffe..0283c43843 100755 --- a/tools/run_tests/artifacts/build_package_ruby.sh +++ b/tools/run_tests/artifacts/build_package_ruby.sh @@ -15,7 +15,7 @@ set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." base=$(pwd) @@ -23,7 +23,7 @@ mkdir -p artifacts/ # All the ruby packages have been built in the artifact phase already # and we only collect them here to deliver them to the distribtest phase. -cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/ruby_native_gem_*/* artifacts/ || true +cp -r "$EXTERNAL_GIT_ROOT"/platform={windows,linux,macos}/artifacts/ruby_native_gem_*/* artifacts/ || true well_known_protos=( any api compiler/plugin descriptor duration empty field_mask source_context struct timestamp type wrappers ) @@ -43,16 +43,16 @@ for arch in {x86,x64}; do for plat in {windows,linux,macos}; do input_dir="$EXTERNAL_GIT_ROOT/platform=${plat}/artifacts/protoc_${plat}_${arch}" output_dir="$base/src/ruby/tools/bin/${ruby_arch}-${plat}" - mkdir -p $output_dir/google/protobuf - mkdir -p $output_dir/google/protobuf/compiler # needed for plugin.proto - cp $input_dir/protoc* $output_dir/ - cp $input_dir/grpc_ruby_plugin* $output_dir/ + mkdir -p "$output_dir"/google/protobuf + mkdir -p "$output_dir"/google/protobuf/compiler # needed for plugin.proto + cp "$input_dir"/protoc* "$output_dir"/ + cp "$input_dir"/grpc_ruby_plugin* "$output_dir"/ for proto in "${well_known_protos[@]}"; do - cp $base/third_party/protobuf/src/google/protobuf/$proto.proto $output_dir/google/protobuf/$proto.proto + cp "$base/third_party/protobuf/src/google/protobuf/$proto.proto" "$output_dir/google/protobuf/$proto.proto" done done done -cd $base/src/ruby/tools +cd "$base/src/ruby/tools" gem build grpc-tools.gemspec -cp ./grpc-tools*.gem $base/artifacts/ +cp ./grpc-tools*.gem "$base/artifacts/" diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index b2cc16acd4..fdf094cd01 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -174,11 +174,13 @@ class PythonDistribTest(object): class RubyDistribTest(object): """Tests Ruby package""" - def __init__(self, platform, arch, docker_suffix): - self.name = 'ruby_%s_%s_%s' % (platform, arch, docker_suffix) + def __init__(self, platform, arch, docker_suffix, ruby_version=None): + self.name = 'ruby_%s_%s_%s_version_%s' % (platform, arch, docker_suffix, + ruby_version or 'unspecified') self.platform = platform self.arch = arch self.docker_suffix = docker_suffix + self.ruby_version = ruby_version self.labels = ['distribtest', 'ruby', platform, arch, docker_suffix] def pre_build_jobspecs(self): @@ -192,10 +194,13 @@ class RubyDistribTest(object): if not self.platform == 'linux': raise Exception("Not supported yet.") + dockerfile_name = 'tools/dockerfile/distribtest/ruby_%s_%s' % ( + self.docker_suffix, self.arch) + if self.ruby_version is not None: + dockerfile_name += '_%s' % self.ruby_version return create_docker_jobspec( self.name, - 'tools/dockerfile/distribtest/ruby_%s_%s' % (self.docker_suffix, - self.arch), + dockerfile_name, 'test/distrib/ruby/run_distrib_test.sh %s %s' % (arch_to_gem_arch[self.arch], self.platform), copy_rel_path='test/distrib') @@ -314,6 +319,7 @@ def targets(): RubyDistribTest('linux', 'x64', 'wheezy'), RubyDistribTest('linux', 'x64', 'jessie'), RubyDistribTest('linux', 'x86', 'jessie'), + RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_0_0'), RubyDistribTest('linux', 'x64', 'centos6'), RubyDistribTest('linux', 'x64', 'centos7'), RubyDistribTest('linux', 'x64', 'fedora20'), diff --git a/tools/run_tests/artifacts/run_in_workspace.sh b/tools/run_tests/artifacts/run_in_workspace.sh index 5b8af6ab53..20181e077c 100755 --- a/tools/run_tests/artifacts/run_in_workspace.sh +++ b/tools/run_tests/artifacts/run_in_workspace.sh @@ -18,15 +18,19 @@ # All cmdline args will be executed as a command. set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." export repo_root=$(pwd) +# TODO: fix file to pass shellcheck + rm -rf "${WORKSPACE_NAME}" git clone . "${WORKSPACE_NAME}" # clone gRPC submodules, use data from locally cloned submodules where possible +# shellcheck disable=SC1004,SC2016 git submodule foreach 'cd "${repo_root}/${WORKSPACE_NAME}" \ && git submodule update --init --reference ${repo_root}/${name} ${name}' echo "Running in workspace ${WORKSPACE_NAME}" -cd ${WORKSPACE_NAME} +cd "${WORKSPACE_NAME}" +# shellcheck disable=SC2068 $@ diff --git a/tools/run_tests/generated/configs.json b/tools/run_tests/generated/configs.json index fee8290efe..a14340cb7b 100644 --- a/tools/run_tests/generated/configs.json +++ b/tools/run_tests/generated/configs.json @@ -42,7 +42,7 @@ } }, { - "config": "c++-compat" + "config": "noexcept" }, { "config": "ubsan", @@ -74,6 +74,9 @@ "config": "lto" }, { + "config": "c++-compat" + }, + { "config": "mutrace" }, { diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 51f0ac7ca6..982d9ef649 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -45,7 +45,7 @@ "language": "c", "name": "alloc_test", "src": [ - "test/core/support/alloc_test.cc" + "test/core/gpr/alloc_test.cc" ], "third_party": false, "type": "target" @@ -94,7 +94,7 @@ "language": "c", "name": "arena_test", "src": [ - "test/core/support/arena_test.cc" + "test/core/gpr/arena_test.cc" ], "third_party": false, "type": "target" @@ -597,7 +597,7 @@ "language": "c", "name": "gpr_avl_test", "src": [ - "test/core/support/avl_test.cc" + "test/core/gpr/avl_test.cc" ], "third_party": false, "type": "target" @@ -612,7 +612,7 @@ "language": "c", "name": "gpr_cmdline_test", "src": [ - "test/core/support/cmdline_test.cc" + "test/core/gpr/cmdline_test.cc" ], "third_party": false, "type": "target" @@ -627,7 +627,7 @@ "language": "c", "name": "gpr_cpu_test", "src": [ - "test/core/support/cpu_test.cc" + "test/core/gpr/cpu_test.cc" ], "third_party": false, "type": "target" @@ -642,7 +642,7 @@ "language": "c", "name": "gpr_env_test", "src": [ - "test/core/support/env_test.cc" + "test/core/gpr/env_test.cc" ], "third_party": false, "type": "target" @@ -657,7 +657,7 @@ "language": "c", "name": "gpr_host_port_test", "src": [ - "test/core/support/host_port_test.cc" + "test/core/gpr/host_port_test.cc" ], "third_party": false, "type": "target" @@ -672,7 +672,7 @@ "language": "c", "name": "gpr_log_test", "src": [ - "test/core/support/log_test.cc" + "test/core/gpr/log_test.cc" ], "third_party": false, "type": "target" @@ -687,7 +687,7 @@ "language": "c", "name": "gpr_manual_constructor_test", "src": [ - "test/core/support/manual_constructor_test.cc" + "test/core/gpr++/manual_constructor_test.cc" ], "third_party": false, "type": "target" @@ -702,7 +702,7 @@ "language": "c", "name": "gpr_mpscq_test", "src": [ - "test/core/support/mpscq_test.cc" + "test/core/gpr/mpscq_test.cc" ], "third_party": false, "type": "target" @@ -717,7 +717,7 @@ "language": "c", "name": "gpr_spinlock_test", "src": [ - "test/core/support/spinlock_test.cc" + "test/core/gpr/spinlock_test.cc" ], "third_party": false, "type": "target" @@ -732,7 +732,7 @@ "language": "c", "name": "gpr_string_test", "src": [ - "test/core/support/string_test.cc" + "test/core/gpr/string_test.cc" ], "third_party": false, "type": "target" @@ -747,7 +747,7 @@ "language": "c", "name": "gpr_sync_test", "src": [ - "test/core/support/sync_test.cc" + "test/core/gpr/sync_test.cc" ], "third_party": false, "type": "target" @@ -762,7 +762,7 @@ "language": "c", "name": "gpr_thd_test", "src": [ - "test/core/support/thd_test.cc" + "test/core/gpr/thd_test.cc" ], "third_party": false, "type": "target" @@ -777,7 +777,7 @@ "language": "c", "name": "gpr_time_test", "src": [ - "test/core/support/time_test.cc" + "test/core/gpr/time_test.cc" ], "third_party": false, "type": "target" @@ -792,7 +792,7 @@ "language": "c", "name": "gpr_tls_test", "src": [ - "test/core/support/tls_test.cc" + "test/core/gpr/tls_test.cc" ], "third_party": false, "type": "target" @@ -807,7 +807,7 @@ "language": "c", "name": "gpr_useful_test", "src": [ - "test/core/support/useful_test.cc" + "test/core/gpr/useful_test.cc" ], "third_party": false, "type": "target" @@ -1636,7 +1636,7 @@ "language": "c", "name": "murmur_hash_test", "src": [ - "test/core/support/murmur_hash_test.cc" + "test/core/gpr/murmur_hash_test.cc" ], "third_party": false, "type": "target" @@ -3172,6 +3172,25 @@ "headers": [], "is_filegroup": false, "language": "c++", + "name": "exception_test", + "src": [ + "test/cpp/end2end/exception_test.cc" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", + "grpc++_test_util", + "grpc_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c++", "name": "filter_end2end_test", "src": [ "test/cpp/end2end/filter_end2end_test.cc" @@ -3515,6 +3534,25 @@ "gpr_test_util", "grpc", "grpc++", + "grpc++_test", + "grpc_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c++", + "name": "inlined_vector_test", + "src": [ + "test/core/gpr++/inlined_vector_test.cc" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", "grpc++_core_stats", "grpc++_test_config", "grpc++_test_util", @@ -3624,7 +3662,7 @@ "language": "c++", "name": "memory_test", "src": [ - "test/core/support/memory_test.cc" + "test/core/gpr++/memory_test.cc" ], "third_party": false, "type": "target" @@ -3694,6 +3732,25 @@ "gpr_test_util", "grpc", "grpc++", + "grpc++_test", + "grpc_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c++", + "name": "orphanable_test", + "src": [ + "test/core/gpr++/orphanable_test.cc" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", "grpc++_proto_reflection_desc_db", "grpc++_reflection", "grpc++_test_util", @@ -3894,7 +3951,7 @@ "language": "c++", "name": "ref_counted_ptr_test", "src": [ - "test/core/support/ref_counted_ptr_test.cc" + "test/core/gpr++/ref_counted_ptr_test.cc" ], "third_party": false, "type": "target" @@ -3913,7 +3970,7 @@ "language": "c++", "name": "ref_counted_test", "src": [ - "test/core/support/ref_counted_test.cc" + "test/core/gpr++/ref_counted_test.cc" ], "third_party": false, "type": "target" @@ -4268,25 +4325,6 @@ "gpr_test_util", "grpc", "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "vector_test", - "src": [ - "test/core/support/vector_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc++", "grpc++_test_util", "grpc_test_util" ], @@ -7789,50 +7827,50 @@ "language": "c", "name": "gpr_base", "src": [ + "src/core/lib/gpr/alloc.cc", + "src/core/lib/gpr/arena.cc", + "src/core/lib/gpr/atm.cc", + "src/core/lib/gpr/avl.cc", + "src/core/lib/gpr/cmdline.cc", + "src/core/lib/gpr/cpu_iphone.cc", + "src/core/lib/gpr/cpu_linux.cc", + "src/core/lib/gpr/cpu_posix.cc", + "src/core/lib/gpr/cpu_windows.cc", + "src/core/lib/gpr/env_linux.cc", + "src/core/lib/gpr/env_posix.cc", + "src/core/lib/gpr/env_windows.cc", + "src/core/lib/gpr/fork.cc", + "src/core/lib/gpr/host_port.cc", + "src/core/lib/gpr/log.cc", + "src/core/lib/gpr/log_android.cc", + "src/core/lib/gpr/log_linux.cc", + "src/core/lib/gpr/log_posix.cc", + "src/core/lib/gpr/log_windows.cc", + "src/core/lib/gpr/mpscq.cc", + "src/core/lib/gpr/murmur_hash.cc", + "src/core/lib/gpr/string.cc", + "src/core/lib/gpr/string_posix.cc", + "src/core/lib/gpr/string_util_windows.cc", + "src/core/lib/gpr/string_windows.cc", + "src/core/lib/gpr/subprocess_posix.cc", + "src/core/lib/gpr/subprocess_windows.cc", + "src/core/lib/gpr/sync.cc", + "src/core/lib/gpr/sync_posix.cc", + "src/core/lib/gpr/sync_windows.cc", + "src/core/lib/gpr/thd.cc", + "src/core/lib/gpr/thd_posix.cc", + "src/core/lib/gpr/thd_windows.cc", + "src/core/lib/gpr/time.cc", + "src/core/lib/gpr/time_posix.cc", + "src/core/lib/gpr/time_precise.cc", + "src/core/lib/gpr/time_windows.cc", + "src/core/lib/gpr/tls_pthread.cc", + "src/core/lib/gpr/tmpfile_msys.cc", + "src/core/lib/gpr/tmpfile_posix.cc", + "src/core/lib/gpr/tmpfile_windows.cc", + "src/core/lib/gpr/wrap_memcpy.cc", "src/core/lib/profiling/basic_timers.cc", - "src/core/lib/profiling/stap_timers.cc", - "src/core/lib/support/alloc.cc", - "src/core/lib/support/arena.cc", - "src/core/lib/support/atm.cc", - "src/core/lib/support/avl.cc", - "src/core/lib/support/cmdline.cc", - "src/core/lib/support/cpu_iphone.cc", - "src/core/lib/support/cpu_linux.cc", - "src/core/lib/support/cpu_posix.cc", - "src/core/lib/support/cpu_windows.cc", - "src/core/lib/support/env_linux.cc", - "src/core/lib/support/env_posix.cc", - "src/core/lib/support/env_windows.cc", - "src/core/lib/support/fork.cc", - "src/core/lib/support/host_port.cc", - "src/core/lib/support/log.cc", - "src/core/lib/support/log_android.cc", - "src/core/lib/support/log_linux.cc", - "src/core/lib/support/log_posix.cc", - "src/core/lib/support/log_windows.cc", - "src/core/lib/support/mpscq.cc", - "src/core/lib/support/murmur_hash.cc", - "src/core/lib/support/string.cc", - "src/core/lib/support/string_posix.cc", - "src/core/lib/support/string_util_windows.cc", - "src/core/lib/support/string_windows.cc", - "src/core/lib/support/subprocess_posix.cc", - "src/core/lib/support/subprocess_windows.cc", - "src/core/lib/support/sync.cc", - "src/core/lib/support/sync_posix.cc", - "src/core/lib/support/sync_windows.cc", - "src/core/lib/support/thd.cc", - "src/core/lib/support/thd_posix.cc", - "src/core/lib/support/thd_windows.cc", - "src/core/lib/support/time.cc", - "src/core/lib/support/time_posix.cc", - "src/core/lib/support/time_precise.cc", - "src/core/lib/support/time_windows.cc", - "src/core/lib/support/tls_pthread.cc", - "src/core/lib/support/tmpfile_msys.cc", - "src/core/lib/support/tmpfile_posix.cc", - "src/core/lib/support/tmpfile_windows.cc", - "src/core/lib/support/wrap_memcpy.cc" + "src/core/lib/profiling/stap_timers.cc" ], "third_party": false, "type": "filegroup" @@ -7868,24 +7906,24 @@ "include/grpc/support/tls_msvc.h", "include/grpc/support/tls_pthread.h", "include/grpc/support/useful.h", - "src/core/lib/profiling/timers.h", - "src/core/lib/support/abstract.h", - "src/core/lib/support/arena.h", - "src/core/lib/support/atomic.h", - "src/core/lib/support/atomic_with_atm.h", - "src/core/lib/support/atomic_with_std.h", - "src/core/lib/support/env.h", - "src/core/lib/support/fork.h", - "src/core/lib/support/manual_constructor.h", - "src/core/lib/support/memory.h", - "src/core/lib/support/mpscq.h", - "src/core/lib/support/murmur_hash.h", - "src/core/lib/support/spinlock.h", - "src/core/lib/support/string.h", - "src/core/lib/support/string_windows.h", - "src/core/lib/support/thd_internal.h", - "src/core/lib/support/time_precise.h", - "src/core/lib/support/tmpfile.h" + "src/core/lib/gpr++/abstract.h", + "src/core/lib/gpr++/atomic.h", + "src/core/lib/gpr++/atomic_with_atm.h", + "src/core/lib/gpr++/atomic_with_std.h", + "src/core/lib/gpr++/manual_constructor.h", + "src/core/lib/gpr++/memory.h", + "src/core/lib/gpr/arena.h", + "src/core/lib/gpr/env.h", + "src/core/lib/gpr/fork.h", + "src/core/lib/gpr/mpscq.h", + "src/core/lib/gpr/murmur_hash.h", + "src/core/lib/gpr/spinlock.h", + "src/core/lib/gpr/string.h", + "src/core/lib/gpr/string_windows.h", + "src/core/lib/gpr/thd_internal.h", + "src/core/lib/gpr/time_precise.h", + "src/core/lib/gpr/tmpfile.h", + "src/core/lib/profiling/timers.h" ], "is_filegroup": true, "language": "c", @@ -7917,24 +7955,24 @@ "include/grpc/support/tls_msvc.h", "include/grpc/support/tls_pthread.h", "include/grpc/support/useful.h", - "src/core/lib/profiling/timers.h", - "src/core/lib/support/abstract.h", - "src/core/lib/support/arena.h", - "src/core/lib/support/atomic.h", - "src/core/lib/support/atomic_with_atm.h", - "src/core/lib/support/atomic_with_std.h", - "src/core/lib/support/env.h", - "src/core/lib/support/fork.h", - "src/core/lib/support/manual_constructor.h", - "src/core/lib/support/memory.h", - "src/core/lib/support/mpscq.h", - "src/core/lib/support/murmur_hash.h", - "src/core/lib/support/spinlock.h", - "src/core/lib/support/string.h", - "src/core/lib/support/string_windows.h", - "src/core/lib/support/thd_internal.h", - "src/core/lib/support/time_precise.h", - "src/core/lib/support/tmpfile.h" + "src/core/lib/gpr++/abstract.h", + "src/core/lib/gpr++/atomic.h", + "src/core/lib/gpr++/atomic_with_atm.h", + "src/core/lib/gpr++/atomic_with_std.h", + "src/core/lib/gpr++/manual_constructor.h", + "src/core/lib/gpr++/memory.h", + "src/core/lib/gpr/arena.h", + "src/core/lib/gpr/env.h", + "src/core/lib/gpr/fork.h", + "src/core/lib/gpr/mpscq.h", + "src/core/lib/gpr/murmur_hash.h", + "src/core/lib/gpr/spinlock.h", + "src/core/lib/gpr/string.h", + "src/core/lib/gpr/string_windows.h", + "src/core/lib/gpr/thd_internal.h", + "src/core/lib/gpr/time_precise.h", + "src/core/lib/gpr/tmpfile.h", + "src/core/lib/profiling/timers.h" ], "third_party": false, "type": "filegroup" @@ -8191,6 +8229,11 @@ "src/core/lib/compression/stream_compression_identity.h", "src/core/lib/debug/stats.h", "src/core/lib/debug/stats_data.h", + "src/core/lib/gpr++/debug_location.h", + "src/core/lib/gpr++/inlined_vector.h", + "src/core/lib/gpr++/orphanable.h", + "src/core/lib/gpr++/ref_counted.h", + "src/core/lib/gpr++/ref_counted_ptr.h", "src/core/lib/http/format_request.h", "src/core/lib/http/httpcli.h", "src/core/lib/http/parser.h", @@ -8266,10 +8309,6 @@ "src/core/lib/slice/slice_hash_table.h", "src/core/lib/slice/slice_internal.h", "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/support/debug_location.h", - "src/core/lib/support/ref_counted.h", - "src/core/lib/support/ref_counted_ptr.h", - "src/core/lib/support/vector.h", "src/core/lib/surface/alarm_internal.h", "src/core/lib/surface/api_trace.h", "src/core/lib/surface/call.h", @@ -8331,6 +8370,11 @@ "src/core/lib/compression/stream_compression_identity.h", "src/core/lib/debug/stats.h", "src/core/lib/debug/stats_data.h", + "src/core/lib/gpr++/debug_location.h", + "src/core/lib/gpr++/inlined_vector.h", + "src/core/lib/gpr++/orphanable.h", + "src/core/lib/gpr++/ref_counted.h", + "src/core/lib/gpr++/ref_counted_ptr.h", "src/core/lib/http/format_request.h", "src/core/lib/http/httpcli.h", "src/core/lib/http/parser.h", @@ -8406,10 +8450,6 @@ "src/core/lib/slice/slice_hash_table.h", "src/core/lib/slice/slice_internal.h", "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/support/debug_location.h", - "src/core/lib/support/ref_counted.h", - "src/core/lib/support/ref_counted_ptr.h", - "src/core/lib/support/vector.h", "src/core/lib/surface/alarm_internal.h", "src/core/lib/surface/api_trace.h", "src/core/lib/surface/call.h", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 6b83cecd41..7b23cab506 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3710,6 +3710,30 @@ "flaky": false, "gtest": true, "language": "c++", + "name": "exception_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", "name": "filter_end2end_test", "platforms": [ "linux", @@ -3943,6 +3967,30 @@ "ci_platforms": [ "linux", "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "inlined_vector_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", "posix" ], "cpu_cost": 1.0, @@ -4068,6 +4116,30 @@ "flaky": false, "gtest": true, "language": "c++", + "name": "orphanable_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", "name": "proto_server_reflection_test", "platforms": [ "linux", @@ -4510,30 +4582,6 @@ "ci_platforms": [ "linux", "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": true, - "language": "c++", - "name": "vector_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": true - }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", "posix" ], "cpu_cost": 0.5, @@ -105395,6 +105443,29 @@ }, { "args": [ + "test/core/end2end/fuzzers/api_fuzzer_corpus/fuzz-input-d2ab5" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [ + "tsan" + ], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "api_fuzzer_one_entry", + "platforms": [ + "mac", + "linux" + ], + "uses_polling": false + }, + { + "args": [ "test/core/end2end/fuzzers/api_fuzzer_corpus/poc-c726ee220e980ed6ad17809fd9efe2844ee61555ac08e4f88afd8901cc2dd53a" ], "ci_platforms": [ diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index c8e917f117..6b27d6f875 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1127,6 +1127,7 @@ class Sanity(object): environ = {'TEST': 'true'} if _is_use_docker_child(): environ['CLANG_FORMAT_SKIP_DOCKER'] = 'true' + environ['CLANG_TIDY_SKIP_DOCKER'] = 'true' return [ self.config.job_spec( cmd['script'].split(), diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index ac90bef5ac..344035478b 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -313,6 +313,15 @@ def _create_portability_test_jobs(extra_args=[], extra_envs={'GRPC_DNS_RESOLVER': 'ares'}, timeout_seconds=_CPP_RUNTESTS_TIMEOUT) + # C and C++ with no-exceptions on Linux + test_jobs += _generate_jobs( + languages=['c', 'c++'], + configs=['noexcept'], + platforms=['linux'], + labels=['portability', 'corelang'], + extra_args=extra_args, + timeout_seconds=_CPP_RUNTESTS_TIMEOUT) + # TODO(zyc): Turn on this test after adding c-ares support on windows. # C with the c-ares DNS resolver on Windows # test_jobs += _generate_jobs(languages=['c'], diff --git a/tools/run_tests/sanity/check_shellcheck.sh b/tools/run_tests/sanity/check_shellcheck.sh index f2cba1892b..b30febab04 100755 --- a/tools/run_tests/sanity/check_shellcheck.sh +++ b/tools/run_tests/sanity/check_shellcheck.sh @@ -19,6 +19,7 @@ set -e ROOT="$(dirname "$0")/../../.." DIRS=( + 'tools/run_tests/artifacts' 'tools/run_tests/helper_scripts' 'tools/run_tests/sanity' ) diff --git a/tools/run_tests/sanity/core_banned_functions.py b/tools/run_tests/sanity/core_banned_functions.py index 9ee28964a5..989990542e 100755 --- a/tools/run_tests/sanity/core_banned_functions.py +++ b/tools/run_tests/sanity/core_banned_functions.py @@ -42,8 +42,8 @@ BANNED_EXCEPT = { 'grpc_closure_run(': ['src/core/lib/iomgr/closure.c'], 'grpc_closure_list_sched(': ['src/core/lib/iomgr/closure.c'], 'gpr_getenv_silent(': [ - 'src/core/lib/support/log.c', 'src/core/lib/support/env_linux.c', - 'src/core/lib/support/env_posix.c', 'src/core/lib/support/env_windows.c' + 'src/core/lib/gpr/log.c', 'src/core/lib/gpr/env_linux.c', + 'src/core/lib/gpr/env_posix.c', 'src/core/lib/gpr/env_windows.c' ], } diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index dab991a7b1..efdb4d84b5 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -14,11 +14,11 @@ cpu_cost: 3 - script: tools/distrib/check_copyright.py - script: tools/distrib/clang_format_code.sh +- script: tools/distrib/clang_tidy_code.sh - 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 -- script: tools/run_tests/sanity/check_clang_tidy.sh cpu_cost: 1000 |