Merge pull request #20510 from jtattermusch/bazel_test_on_mac

Start running bazel C/C++ tests on mac
pull/21310/head
Jan Tattermusch 5 years ago committed by GitHub
commit aa40b1c8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/lib/iomgr/endpoint_pair_posix.cc
  2. 3
      src/core/lib/iomgr/port.h
  3. 2
      src/core/lib/iomgr/udp_server.cc
  4. 3
      test/core/backoff/backoff_test.cc
  5. 3
      test/core/bad_client/tests/large_metadata.cc
  6. 6
      test/core/bad_connection/close_fd_test.cc
  7. 6
      test/core/end2end/dualstack_socket_test.cc
  8. 6
      test/core/handshake/client_ssl.cc
  9. 6
      test/core/handshake/verify_peer_options.cc
  10. 5
      test/core/iomgr/BUILD
  11. 6
      test/core/iomgr/fd_posix_test.cc
  12. 6
      test/core/iomgr/socket_utils_test.cc
  13. 6
      test/core/iomgr/tcp_client_posix_test.cc
  14. 6
      test/core/iomgr/tcp_posix_test.cc
  15. 6
      test/core/iomgr/tcp_server_posix_test.cc
  16. 6
      test/core/iomgr/udp_server_test.cc
  17. 18
      test/core/security/credentials_test.cc
  18. 2
      test/core/surface/byte_buffer_reader_test.cc
  19. 2
      test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc
  20. 2
      test/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_test.cc
  21. 2
      test/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector_test.cc
  22. 4
      test/cpp/common/timer_test.cc
  23. 8
      test/cpp/end2end/async_end2end_test.cc
  24. 5
      test/cpp/end2end/client_callback_end2end_test.cc
  25. 8
      test/cpp/end2end/end2end_test.cc
  26. 20
      test/cpp/microbenchmarks/BUILD
  27. 2
      test/cpp/naming/generate_resolver_component_tests.bzl
  28. 23
      tools/internal_ci/macos/grpc_bazel_c_cpp_dbg.cfg
  29. 23
      tools/internal_ci/macos/grpc_bazel_c_cpp_opt.cfg
  30. 37
      tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh
  31. 9
      tools/remote_build/README.md
  32. 35
      tools/remote_build/mac.bazelrc

@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP
#include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"

@ -134,6 +134,7 @@
#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
#define GRPC_POSIX_SOCKET_EV_POLL 1
#define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1
#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
#define GRPC_POSIX_SOCKET_SOCKADDR 1
#define GRPC_POSIX_SOCKET_SOCKET_FACTORY 1
@ -141,6 +142,7 @@
#define GRPC_POSIX_SOCKET_TCP_CLIENT 1
#define GRPC_POSIX_SOCKET_TCP_SERVER 1
#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
#define GRPC_POSIX_SOCKET_UDP_SERVER 1
#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
#else
#define GRPC_POSIX_SOCKET 1
@ -227,6 +229,7 @@
#define GRPC_POSIX_SOCKET_TCP_CLIENT 1
#define GRPC_POSIX_SOCKET_TCP_SERVER 1
#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
#define GRPC_POSIX_SOCKET_UDP_SERVER 1
#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
#endif

@ -29,7 +29,7 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_UDP_SERVER
#include "src/core/lib/iomgr/udp_server.h"

@ -20,6 +20,7 @@
#include <algorithm>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <gtest/gtest.h>
@ -171,7 +172,9 @@ TEST(BackOffTest, JitterBackOff) {
} // namespace grpc
int main(int argc, char** argv) {
grpc_init();
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
grpc_shutdown();
}

@ -140,7 +140,7 @@ static void server_verifier_sends_too_much_metadata(
int main(int argc, char** argv) {
int i;
grpc_init();
grpc::testing::TestEnvironment env(argc, argv);
// Test sending more metadata than the server will accept.
@ -173,5 +173,6 @@ int main(int argc, char** argv) {
GRPC_RUN_BAD_CLIENT_TEST(server_verifier_sends_too_much_metadata,
rst_stream_client_validator,
PFX_TOO_MUCH_METADATA_FROM_SERVER_STR, 0);
grpc_shutdown();
return 0;
}

@ -24,7 +24,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP
#include "test/core/util/test_config.h"
@ -751,8 +751,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_TCP */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_TCP */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
#include <string.h>
@ -370,8 +370,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_EV */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_EV */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP
#include <arpa/inet.h>
#include <openssl/err.h>
@ -322,8 +322,8 @@ int main(int /*argc*/, char* /*argv*/ []) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_TCP */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_TCP */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP
#include <arpa/inet.h>
#include <openssl/err.h>
@ -268,8 +268,8 @@ int main(int /*argc*/, char* /*argv*/ []) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_TCP */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_TCP */

@ -254,7 +254,10 @@ grpc_cc_test(
name = "tcp_posix_test",
srcs = ["tcp_posix_test.cc"],
language = "C++",
tags = ["no_windows"],
tags = [
"no_windows",
"no_mac", # TODO(jtattermusch): Reenable once https://github.com/grpc/grpc/issues/21282 is fixed.
],
deps = [
":endpoint_tests",
"//:gpr",

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
#include "src/core/lib/iomgr/ev_posix.h"
@ -533,8 +533,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_EV */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_EV */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
#include "src/core/lib/iomgr/socket_utils_posix.h"
@ -132,8 +132,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_UTILS_COMMON */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_UTILS_COMMON */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP_CLIENT
#include "src/core/lib/iomgr/tcp_client.h"
@ -215,8 +215,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_TCP_CLIENT */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_CLIENT */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP
#include "src/core/lib/iomgr/tcp_posix.h"
@ -645,8 +645,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_TCP */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_TCP */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_TCP_SERVER
#include "src/core/lib/iomgr/tcp_server.h"
@ -506,8 +506,8 @@ int main(int argc, char** argv) {
return EXIT_SUCCESS;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_SERVER */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_SERVER */

@ -19,7 +19,7 @@
#include "src/core/lib/iomgr/port.h"
// This test won't work except with posix sockets enabled
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_UDP_SERVER
#include "src/core/lib/iomgr/udp_server.h"
@ -383,8 +383,8 @@ int main(int argc, char** argv) {
return 0;
}
#else /* GRPC_POSIX_SOCKET */
#else /* GRPC_POSIX_SOCKET_UDP_SERVER */
int main(int argc, char** argv) { return 1; }
#endif /* GRPC_POSIX_SOCKET */
#endif /* GRPC_POSIX_SOCKET_UDP_SERVER */

@ -1440,16 +1440,32 @@ static void test_metadata_plugin_failure(void) {
static void test_get_well_known_google_credentials_file_path(void) {
char* path;
char* home = gpr_getenv("HOME");
bool restore_home_env = false;
#if defined(GRPC_BAZEL_BUILD) && \
(defined(GPR_POSIX_ENV) || defined(GPR_LINUX_ENV))
// when running under bazel locally, the HOME variable is not set
// so we set it to some fake value
restore_home_env = true;
gpr_setenv("HOME", "/fake/home/for/bazel");
#endif /* defined(GRPC_BAZEL_BUILD) && (defined(GPR_POSIX_ENV) || \
defined(GPR_LINUX_ENV)) */
path = grpc_get_well_known_google_credentials_file_path();
GPR_ASSERT(path != nullptr);
gpr_free(path);
#if defined(GPR_POSIX_ENV) || defined(GPR_LINUX_ENV)
restore_home_env = true;
gpr_unsetenv("HOME");
path = grpc_get_well_known_google_credentials_file_path();
GPR_ASSERT(path == nullptr);
gpr_setenv("HOME", home);
gpr_free(path);
#endif /* GPR_POSIX_ENV || GPR_LINUX_ENV */
if (restore_home_env) {
if (home) {
gpr_setenv("HOME", home);
} else {
gpr_unsetenv("HOME");
}
}
gpr_free(home);
}

@ -334,6 +334,7 @@ static void test_byte_buffer_copy(void) {
}
int main(int argc, char** argv) {
grpc_init();
grpc::testing::TestEnvironment env(argc, argv);
test_read_one_slice();
test_read_one_slice_malloc();
@ -347,5 +348,6 @@ int main(int argc, char** argv) {
test_byte_buffer_from_reader();
test_byte_buffer_copy();
test_readall();
grpc_shutdown();
return 0;
}

@ -68,7 +68,9 @@ static void deserialize_response_test() {
int main(int /*argc*/, char** /*argv*/) {
/* Tests. */
grpc_init();
deserialize_response_test();
convert_to_tsi_result_test();
grpc_shutdown();
return 0;
}

@ -445,6 +445,7 @@ static void alts_grpc_record_protocol_tests(
}
int main(int /*argc*/, char** /*argv*/) {
grpc_init();
alts_grpc_record_protocol_tests(
&test_fixture_integrity_only_no_rekey_no_extra_copy_create);
alts_grpc_record_protocol_tests(&test_fixture_integrity_only_rekey_create);
@ -453,6 +454,7 @@ int main(int /*argc*/, char** /*argv*/) {
alts_grpc_record_protocol_tests(
&test_fixture_privacy_integrity_no_rekey_create);
alts_grpc_record_protocol_tests(&test_fixture_privacy_integrity_rekey_create);
grpc_shutdown();
return 0;
}

@ -296,6 +296,7 @@ static void alts_zero_copy_protector_seal_unseal_large_buffer_tests(
}
int main(int /*argc*/, char** /*argv*/) {
grpc_init();
alts_zero_copy_protector_seal_unseal_small_buffer_tests(
/*enable_extra_copy=*/false);
alts_zero_copy_protector_seal_unseal_small_buffer_tests(
@ -304,5 +305,6 @@ int main(int /*argc*/, char** /*argv*/) {
/*enable_extra_copy=*/false);
alts_zero_copy_protector_seal_unseal_large_buffer_tests(
/*enable_extra_copy=*/true);
grpc_shutdown();
return 0;
}

@ -27,7 +27,7 @@
#include "src/core/lib/iomgr/timer_manager.h"
#include "test/core/util/test_config.h"
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
#include "src/core/lib/iomgr/ev_posix.h"
#endif
@ -46,7 +46,7 @@ class TimerTest : public ::testing::Test {
grpc_init();
// Skip test if slowdown factor > 1, or we are
// using event manager.
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
if (grpc_test_slowdown_factor() != 1 ||
grpc_event_engine_run_in_background()) {
#else

@ -43,9 +43,9 @@
#include "test/cpp/util/string_ref_helper.h"
#include "test/cpp/util/test_credentials_provider.h"
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
#include "src/core/lib/iomgr/ev_posix.h"
#endif // GRPC_POSIX_SOCKET
#endif // GRPC_POSIX_SOCKET_EV
#include <gtest/gtest.h>
@ -362,14 +362,14 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
return;
}
int poller_slowdown_factor = 1;
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
if (0 == strcmp(poller.get(), "poll")) {
poller_slowdown_factor = 2;
}
#endif // GRPC_POSIX_SOCKET
#endif // GRPC_POSIX_SOCKET_EV
ResetStub();
SendRpc(1);
server_->Shutdown();

@ -1386,7 +1386,10 @@ INSTANTIATE_TEST_SUITE_P(ClientCallbackEnd2endTest, ClientCallbackEnd2endTest,
} // namespace grpc
int main(int argc, char** argv) {
grpc_init();
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
int ret = RUN_ALL_TESTS();
grpc_shutdown();
return ret;
}

@ -48,9 +48,9 @@
#include "test/cpp/util/string_ref_helper.h"
#include "test/cpp/util/test_credentials_provider.h"
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
#include "src/core/lib/iomgr/ev_posix.h"
#endif // GRPC_POSIX_SOCKET
#endif // GRPC_POSIX_SOCKET_EV
#include <gtest/gtest.h>
@ -833,12 +833,12 @@ TEST_P(End2endTest, ReconnectChannel) {
int poller_slowdown_factor = 1;
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
#ifdef GRPC_POSIX_SOCKET
#ifdef GRPC_POSIX_SOCKET_EV
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
if (0 == strcmp(poller.get(), "poll")) {
poller_slowdown_factor = 2;
}
#endif // GRPC_POSIX_SOCKET
#endif // GRPC_POSIX_SOCKET_EV
ResetStub();
SendRpc(stub_.get(), 1, false);
RestartServer(std::shared_ptr<AuthMetadataProcessor>());

@ -136,7 +136,10 @@ grpc_cc_binary(
srcs = [
"bm_fullstack_streaming_ping_pong.cc",
],
tags = ["no_windows"],
tags = [
"no_windows",
"no_mac", # to emulate "excluded_poll_engines: poll"
],
deps = [":fullstack_streaming_ping_pong_h"],
)
@ -155,7 +158,10 @@ grpc_cc_binary(
srcs = [
"bm_fullstack_streaming_pump.cc",
],
tags = ["no_windows"],
tags = [
"no_windows",
"no_mac", # to emulate "excluded_poll_engines: poll"
],
deps = [":fullstack_streaming_pump_h"],
)
@ -163,7 +169,10 @@ grpc_cc_binary(
name = "bm_fullstack_trickle",
testonly = 1,
srcs = ["bm_fullstack_trickle.cc"],
tags = ["no_windows"],
tags = [
"no_windows",
"no_mac", # to emulate "excluded_poll_engines: poll"
],
deps = [":helpers"],
)
@ -182,7 +191,10 @@ grpc_cc_binary(
srcs = [
"bm_fullstack_unary_ping_pong.cc",
],
tags = ["no_windows"],
tags = [
"no_windows",
"no_mac", # to emulate "excluded_poll_engines: poll"
],
deps = [":fullstack_unary_ping_pong_h"],
)

@ -82,5 +82,5 @@ def generate_resolver_component_tests():
"--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix,
"--running_under_bazel=true",
],
tags = ["no_windows"],
tags = ["no_windows", "no_mac"],
)

@ -16,7 +16,26 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh"
timeout_mins: 90
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
bazel_setting {
# In order for Kokoro to recognize this as a bazel build and publish the bazel resultstore link,
# the bazel_setting section needs to be present and "upsalite_frontend_address" needs to be
# set. The rest of configuration from bazel_setting is unused (we configure everything when bazel
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
env_vars {
# flags will be passed to bazel invocation
key: "BAZEL_FLAGS"
value: "--cache_test_results=no --config=dbg"
}
env_vars {
key: "RUN_TESTS_FLAGS"
value: "--config=dbg"
key: "UPLOAD_TEST_RESULTS"
value: "true"
}

@ -16,7 +16,26 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh"
timeout_mins: 90
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
bazel_setting {
# In order for Kokoro to recognize this as a bazel build and publish the bazel resultstore link,
# the bazel_setting section needs to be present and "upsalite_frontend_address" needs to be
# set. The rest of configuration from bazel_setting is unused (we configure everything when bazel
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
env_vars {
# flags will be passed to bazel invocation
key: "BAZEL_FLAGS"
value: "--cache_test_results=no --config=opt"
}
env_vars {
key: "RUN_TESTS_FLAGS"
value: "--config=opt"
key: "UPLOAD_TEST_RESULTS"
value: "true"
}

@ -18,13 +18,40 @@ set -ex
# change to grpc repo root
cd $(dirname $0)/../../..
# TODO(jtattermusch): most of the prepare steps should not be needed for bazel
source tools/internal_ci/helper_scripts/prepare_build_macos_rc
# make sure bazel is available
tools/bazel version
./tools/run_tests/start_port_server.py
# to get "bazel" link for kokoro build, we need to generate
# invocation UUID, set a flag for bazel to use it
# and upload "bazel_invocation_ids" file as artifact.
# NOTE: UUID needs to be in lowercase for the result link to work
# (on mac "uuidgen" outputs uppercase UUID)
BAZEL_INVOCATION_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
echo "${BAZEL_INVOCATION_ID}" >"${KOKORO_ARTIFACTS_DIR}/bazel_invocation_ids"
# 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/...
tools/bazel \
--bazelrc=tools/remote_build/mac.bazelrc \
test \
--invocation_id="${BAZEL_INVOCATION_ID}" \
--workspace_status_command=tools/remote_build/workspace_status_kokoro.sh \
--google_credentials="${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json" \
$BAZEL_FLAGS \
-- //test/... || FAILED="true"
# kill port_server.py to prevent the build from hanging
ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9
if [ "$UPLOAD_TEST_RESULTS" != "" ]
then
# Sleep to let ResultStore finish writing results before querying
sleep 60
python ./tools/run_tests/python_utils/upload_rbe_results.py
fi
if [ "$FAILED" != "" ]
then
exit 1
fi

@ -32,7 +32,14 @@ bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/...
Run on Windows MSVC:
```
# manual run of bazel tests remotely on RBE Windows (must be run from Windows machine)
bazel --bazelrc=tools/remote_build/windows.bazelrc test //test/...
bazel --bazelrc=tools/remote_build/windows.bazelrc test --config=windows_opt //test/...
```
Run on MacOS (experimental for now):
```
# manual run of bazel tests on Mac (must be run from Mac machine)
# NOTE: it's not really a "remote execution", but uploads results to ResultStore
bazel --bazelrc=tools/remote_build/mac.bazelrc test --config=opt //test/...
```
Available command line options can be found in

@ -0,0 +1,35 @@
# Configuration for mac bazel test runs on CI
# Bazel RBE doesn't currently support MacOS platform,
# so we configure tests to build and run locally,
# but try to use RBE build cache and upload results
# to ResultStore
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
# remote cache is needed not only for build speedup,
# but also for the test logs to be available in ResultStore
# for now, don't upload results to cache, only the test logs.
# TODO(jtattermusch): setup a "cache-silo-key" before enabling uploads to build cache
build --remote_cache=grpcs://remotebuildexecution.googleapis.com
build --remote_instance_name=projects/grpc-testing/instances/default_instance
build --remote_upload_local_results=false
build --auth_enabled=true
build --verbose_failures=true
build --test_tag_filters=-no_mac
build --build_tag_filters=-no_mac
# without verbose gRPC logs the test outputs are not very useful
test --test_env=GRPC_VERBOSITY=debug
# Set flags for uploading to BES in order to view results in the Bazel Build
# Results UI.
build --bes_backend=grpcs://buildeventservice.googleapis.com
build --bes_timeout=600s
build --bes_results_url="https://source.cloud.google.com/results/invocations/"
build --project_id=grpc-testing
# print output for tests that fail (default is "summary")
build --test_output=errors
Loading…
Cancel
Save