Merge pull request #18285 from billfeng327/update-deps-version

Windows local Bazel build for gRPC C++ tests
pull/18314/head
Bill Feng 6 years ago committed by GitHub
commit d61f690a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      bazel/grpc_build_system.bzl
  2. 9
      bazel/grpc_deps.bzl
  3. 1
      test/core/bad_connection/BUILD
  4. 1
      test/core/client_channel/BUILD
  5. 15
      test/core/end2end/generate_tests.bzl
  6. 10
      test/core/iomgr/BUILD
  7. 1
      test/cpp/common/BUILD
  8. 2
      test/cpp/end2end/BUILD
  9. 1
      test/cpp/interop/BUILD
  10. 18
      test/cpp/microbenchmarks/BUILD
  11. 5
      test/cpp/naming/generate_resolver_component_tests.bzl
  12. 1
      test/cpp/performance/BUILD
  13. 1
      test/cpp/qps/qps_benchmark_script.bzl
  14. 3
      test/cpp/server/BUILD
  15. 1
      test/cpp/server/load_reporter/BUILD
  16. 1
      third_party/BUILD
  17. 15
      third_party/benchmark.BUILD
  18. 6
      tools/remote_build/README.md
  19. 3
      tools/remote_build/windows.bazelrc

@ -28,6 +28,12 @@ load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
# The set of pollers to test against if a test exercises polling
POLLERS = ["epollex", "epoll1", "poll"]
def is_msvc():
return select({
"//:windows_msvc": True,
"//conditions:default": False,
})
def if_not_windows(a):
return select({
"//:windows": [],
@ -80,7 +86,8 @@ def grpc_cc_library(
visibility = None,
alwayslink = 0,
data = [],
use_cfstream = False):
use_cfstream = False,
tags = []):
copts = []
if use_cfstream:
copts = if_mac(["-DGRPC_CFSTREAM"])
@ -116,6 +123,7 @@ def grpc_cc_library(
],
alwayslink = alwayslink,
data = data,
tags = tags,
)
def grpc_proto_plugin(name, srcs = [], deps = []):
@ -158,8 +166,9 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
"size": size,
"timeout": timeout,
"exec_compatible_with": exec_compatible_with,
"tags": tags,
}
if uses_polling:
if uses_polling and not is_msvc():
native.cc_test(testonly = True, tags = ["manual"], **args)
for poller in POLLERS:
native.sh_test(
@ -180,7 +189,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
else:
native.cc_test(**args)
def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = []):
def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = [], tags = []):
copts = []
if language.upper() == "C":
copts = ["-std=c99"]
@ -194,6 +203,7 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
deps = deps + _get_external_deps(external_deps),
copts = copts,
linkopts = if_not_windows(["-pthread"]) + linkopts,
tags = tags,
)
def grpc_generate_one_off_targets():

@ -147,16 +147,15 @@ def grpc_deps():
if "com_github_gflags_gflags" not in native.existing_rules():
http_archive(
name = "com_github_gflags_gflags",
strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e",
url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz",
strip_prefix = "gflags-28f50e0fed19872e0fd50dd23ce2ee8cd759338e",
url = "https://github.com/gflags/gflags/archive/28f50e0fed19872e0fd50dd23ce2ee8cd759338e.tar.gz",
)
if "com_github_google_benchmark" not in native.existing_rules():
http_archive(
name = "com_github_google_benchmark",
build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD",
strip_prefix = "benchmark-9913418d323e64a0111ca0da81388260c2bbe1e9",
url = "https://github.com/google/benchmark/archive/9913418d323e64a0111ca0da81388260c2bbe1e9.tar.gz",
strip_prefix = "benchmark-e776aa0275e293707b6a0901e0e8d8a8a3679508",
url = "https://github.com/google/benchmark/archive/e776aa0275e293707b6a0901e0e8d8a8a3679508.tar.gz",
)
if "com_github_cares_cares" not in native.existing_rules():

@ -29,4 +29,5 @@ grpc_cc_binary(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)

@ -52,6 +52,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(

@ -15,7 +15,7 @@
"""Generates the appropriate build.json data for all the end2end tests."""
load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library")
load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library", "is_msvc")
POLLERS = ["epollex", "epoll1", "poll"]
@ -31,7 +31,8 @@ def _fixture_options(
is_http2 = True,
supports_proxy_auth = False,
supports_write_buffering = True,
client_channel = True):
client_channel = True,
supports_msvc = True,):
return struct(
fullstack = fullstack,
includes_proxy = includes_proxy,
@ -44,6 +45,7 @@ def _fixture_options(
supports_proxy_auth = supports_proxy_auth,
supports_write_buffering = supports_write_buffering,
client_channel = client_channel,
supports_msvc = supports_msvc,
#_platforms=_platforms,
)
@ -119,10 +121,11 @@ END2END_NOSEC_FIXTURES = {
client_channel = False,
secure = False,
_platforms = ["linux", "mac", "posix"],
supports_msvc = False,
),
"h2_full": _fixture_options(secure = False),
"h2_full+pipe": _fixture_options(secure = False, _platforms = ["linux"]),
"h2_full+trace": _fixture_options(secure = False, tracing = True),
"h2_full+pipe": _fixture_options(secure = False, _platforms = ["linux"], supports_msvc = False),
"h2_full+trace": _fixture_options(secure = False, tracing = True, supports_msvc = False),
"h2_full+workarounds": _fixture_options(secure = False),
"h2_http_proxy": _fixture_options(secure = False, supports_proxy_auth = True),
"h2_proxy": _fixture_options(secure = False, includes_proxy = True),
@ -151,6 +154,7 @@ END2END_NOSEC_FIXTURES = {
dns_resolver = False,
_platforms = ["linux", "mac", "posix"],
secure = False,
supports_msvc = False,
),
}
@ -329,6 +333,9 @@ END2END_TESTS = {
}
def _compatible(fopt, topt):
if is_msvc:
if not fopt.supports_msvc:
return False
if topt.needs_fullstack:
if not fopt.fullstack:
return False

@ -81,6 +81,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -92,6 +93,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -103,6 +105,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -139,6 +142,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -153,6 +157,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -214,6 +219,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -225,6 +231,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -237,6 +244,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -259,6 +267,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -303,4 +312,5 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)

@ -28,6 +28,7 @@ grpc_cc_test(
"//:grpc++_unsecure",
"//test/core/util:grpc_test_util_unsecure",
],
tags = ["no_windows"],
)
grpc_cc_test(

@ -99,6 +99,7 @@ grpc_cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -629,6 +630,7 @@ grpc_cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(

@ -161,4 +161,5 @@ grpc_cc_test(
"//test/cpp/util:test_config",
"//test/cpp/util:test_util",
],
tags = ["no_windows"],
)

@ -45,6 +45,7 @@ grpc_cc_library(
"//test/core/util:grpc_test_util_unsecure",
"//test/cpp/util:test_config",
],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -52,6 +53,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_closure.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -59,6 +61,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_alarm.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -66,6 +69,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_arena.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -73,6 +77,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_byte_buffer.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -80,6 +85,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_channel.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -87,6 +93,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_call_create.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -94,6 +101,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_cq.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -101,6 +109,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_cq_multiple_threads.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -108,6 +117,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_error.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_library(
@ -117,6 +127,7 @@ grpc_cc_library(
"fullstack_streaming_ping_pong.h",
],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -126,6 +137,7 @@ grpc_cc_binary(
"bm_fullstack_streaming_ping_pong.cc",
],
deps = [":fullstack_streaming_ping_pong_h"],
tags = ["no_windows"],
)
grpc_cc_library(
@ -144,6 +156,7 @@ grpc_cc_binary(
"bm_fullstack_streaming_pump.cc",
],
deps = [":fullstack_streaming_pump_h"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -151,6 +164,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_fullstack_trickle.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_library(
@ -169,6 +183,7 @@ grpc_cc_binary(
"bm_fullstack_unary_ping_pong.cc",
],
deps = [":fullstack_unary_ping_pong_h"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -176,6 +191,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_metadata.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -183,6 +199,7 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_chttp2_hpack.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)
grpc_cc_binary(
@ -202,4 +219,5 @@ grpc_cc_binary(
testonly = 1,
srcs = ["bm_timer.cc"],
deps = [":helpers"],
tags = ["no_windows"],
)

@ -33,6 +33,7 @@ def generate_resolver_component_tests():
"//:gpr",
"//test/cpp/util:test_config",
],
tags = ["no_windows"],
)
# meant to be invoked only through the top-level shell script driver
grpc_cc_binary(
@ -52,6 +53,7 @@ def generate_resolver_component_tests():
"//:gpr",
"//test/cpp/util:test_config",
],
tags = ["no_windows"],
)
grpc_cc_test(
name = "resolver_component_tests_runner_invoker%s" % unsecure_build_config_suffix,
@ -77,5 +79,6 @@ def generate_resolver_component_tests():
args = [
"--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix,
"--running_under_bazel=true",
]
],
tags = ["no_windows"],
)

@ -31,4 +31,5 @@ grpc_cc_test(
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util_base",
],
tags = ["no_windows"],
)

@ -75,5 +75,6 @@ def json_run_localhost_batch():
],
tags = [
"json_run_localhost",
"no_windows",
],
)

@ -29,6 +29,7 @@ grpc_cc_test(
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util_unsecure",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -42,6 +43,7 @@ grpc_cc_test(
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util_unsecure",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -55,4 +57,5 @@ grpc_cc_test(
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util_unsecure",
],
tags = ["no_windows"],
)

@ -45,6 +45,7 @@ grpc_cc_test(
"//:lb_server_load_reporting_filter",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(

1
third_party/BUILD vendored

@ -1,5 +1,4 @@
exports_files([
"benchmark.BUILD",
"gtest.BUILD",
"objective_c/Cronet/bidirectional_stream_c.h",
"zlib.BUILD",

@ -1,15 +0,0 @@
cc_library(
name = "benchmark",
srcs = glob(["src/*.cc"]),
hdrs = glob(["include/**/*.h", "src/*.h"]),
includes = [
"include", "."
],
copts = [
"-DHAVE_POSIX_REGEX"
],
linkstatic = 1,
visibility = [
"//visibility:public",
],
)

@ -29,5 +29,11 @@ Sanitizer runs (asan, msan, tsan, ubsan):
bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/...
```
Run on Windows MSVC:
```
# local manual run only for C++ targets (RBE to be supported)
bazel --bazelrc=tools/remote_build/windows.bazelrc test //test/cpp/...
```
Available command line options can be found in
[Bazel command line reference](https://docs.bazel.build/versions/master/command-line-reference.html)

@ -0,0 +1,3 @@
# TODO(yfen): Merge with rbe_common.bazelrc and enable Windows RBE
build --test_tag_filters=-no_windows
build --build_tag_filters=-no_windows
Loading…
Cancel
Save