From 52b8306e9104dbca525a3e6b9bba9c47df94cea1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 24 Sep 2019 10:31:54 +0200 Subject: [PATCH] prepare for running macos C/C++ bazel tests --- .../macos/grpc_bazel_c_cpp_dbg.cfg | 22 ++++++++++++++ .../macos/grpc_bazel_c_cpp_opt.cfg | 22 ++++++++++++++ tools/internal_ci/macos/grpc_cfstream.cfg | 2 +- .../internal_ci/macos/grpc_cfstream_asan.cfg | 2 +- .../internal_ci/macos/grpc_cfstream_tsan.cfg | 2 +- .../macos/grpc_run_bazel_c_cpp_tests.sh | 30 +++++++++++++++++++ ...ts.sh => grpc_run_bazel_isolated_tests.sh} | 0 7 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 tools/internal_ci/macos/grpc_bazel_c_cpp_dbg.cfg create mode 100644 tools/internal_ci/macos/grpc_bazel_c_cpp_opt.cfg create mode 100644 tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh rename tools/internal_ci/macos/{grpc_run_bazel_tests.sh => grpc_run_bazel_isolated_tests.sh} (100%) diff --git a/tools/internal_ci/macos/grpc_bazel_c_cpp_dbg.cfg b/tools/internal_ci/macos/grpc_bazel_c_cpp_dbg.cfg new file mode 100644 index 00000000000..bc9b671e1fb --- /dev/null +++ b/tools/internal_ci/macos/grpc_bazel_c_cpp_dbg.cfg @@ -0,0 +1,22 @@ +# Copyright 2019 The 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/macos/grpc_run_bazel_c_cpp_tests.sh" +env_vars { + key: "RUN_TESTS_FLAGS" + value: "--config=dbg" +} diff --git a/tools/internal_ci/macos/grpc_bazel_c_cpp_opt.cfg b/tools/internal_ci/macos/grpc_bazel_c_cpp_opt.cfg new file mode 100644 index 00000000000..62fc5fc1b38 --- /dev/null +++ b/tools/internal_ci/macos/grpc_bazel_c_cpp_opt.cfg @@ -0,0 +1,22 @@ +# Copyright 2019 The 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/macos/grpc_run_bazel_c_cpp_tests.sh" +env_vars { + key: "RUN_TESTS_FLAGS" + value: "--config=opt" +} diff --git a/tools/internal_ci/macos/grpc_cfstream.cfg b/tools/internal_ci/macos/grpc_cfstream.cfg index 2b1ce0a89c7..fd8c7c8f41e 100644 --- a/tools/internal_ci/macos/grpc_cfstream.cfg +++ b/tools/internal_ci/macos/grpc_cfstream.cfg @@ -15,5 +15,5 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_tests.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh" diff --git a/tools/internal_ci/macos/grpc_cfstream_asan.cfg b/tools/internal_ci/macos/grpc_cfstream_asan.cfg index ac8a8b63ff6..8d1756f0965 100644 --- a/tools/internal_ci/macos/grpc_cfstream_asan.cfg +++ b/tools/internal_ci/macos/grpc_cfstream_asan.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_tests.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh" env_vars { key: "RUN_TESTS_FLAGS" value: "--config=asan_macos" diff --git a/tools/internal_ci/macos/grpc_cfstream_tsan.cfg b/tools/internal_ci/macos/grpc_cfstream_tsan.cfg index 52f1f3eec76..a72a8456e16 100644 --- a/tools/internal_ci/macos/grpc_cfstream_tsan.cfg +++ b/tools/internal_ci/macos/grpc_cfstream_tsan.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_tests.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh" env_vars { key: "RUN_TESTS_FLAGS" value: "--config=tsan" diff --git a/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh b/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh new file mode 100644 index 00000000000..434fc1a2804 --- /dev/null +++ b/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Copyright 2019 The 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)/../../.. + +./tools/run_tests/start_port_server.py + +# run all C/C++ tests +# TODO(jtattermusch): try using Bazel RBE remote cache +# TODO(jtattermusch): upload bazel test results to resultstore +tools/bazel test $RUN_TESTS_FLAGS //test/... + +# kill port_server.py to prevent the build from hanging +ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9 + diff --git a/tools/internal_ci/macos/grpc_run_bazel_tests.sh b/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh similarity index 100% rename from tools/internal_ci/macos/grpc_run_bazel_tests.sh rename to tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh