From ccdfcc2ee8846d0db804be2866f3d5b74ec85852 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Sun, 1 Nov 2020 22:54:56 -0800 Subject: [PATCH] Add workaround for bazel --- CMakeLists.txt | 16 ++++++++-------- build_autogenerated.yaml | 4 ++-- test/core/client_channel/resolvers/BUILD | 4 ++-- test/cpp/qps/qps_benchmark_script.bzl | 13 +++++++++++-- tools/run_tests/generated/tests.json | 4 ++-- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b69c00befa7..710b37440b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -556,8 +556,8 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_c concurrent_connectivity_test) add_dependencies(buildtests_c connection_refused_test) add_dependencies(buildtests_c cpu_test) - add_dependencies(buildtests_c dns_resolver_connectivity_using_ares_resolver_test) - add_dependencies(buildtests_c dns_resolver_connectivity_using_native_resolver_test) + add_dependencies(buildtests_c dns_resolver_connectivity_using_ares_test) + add_dependencies(buildtests_c dns_resolver_connectivity_using_native_test) add_dependencies(buildtests_c dns_resolver_cooldown_test) add_dependencies(buildtests_c dns_resolver_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) @@ -5105,11 +5105,11 @@ target_link_libraries(cpu_test endif() if(gRPC_BUILD_TESTS) -add_executable(dns_resolver_connectivity_using_ares_resolver_test +add_executable(dns_resolver_connectivity_using_ares_test test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc ) -target_include_directories(dns_resolver_connectivity_using_ares_resolver_test +target_include_directories(dns_resolver_connectivity_using_ares_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include @@ -5122,7 +5122,7 @@ target_include_directories(dns_resolver_connectivity_using_ares_resolver_test ${_gRPC_ZLIB_INCLUDE_DIR} ) -target_link_libraries(dns_resolver_connectivity_using_ares_resolver_test +target_link_libraries(dns_resolver_connectivity_using_ares_test ${_gRPC_ALLTARGETS_LIBRARIES} grpc_test_util grpc @@ -5135,11 +5135,11 @@ target_link_libraries(dns_resolver_connectivity_using_ares_resolver_test endif() if(gRPC_BUILD_TESTS) -add_executable(dns_resolver_connectivity_using_native_resolver_test +add_executable(dns_resolver_connectivity_using_native_test test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc ) -target_include_directories(dns_resolver_connectivity_using_native_resolver_test +target_include_directories(dns_resolver_connectivity_using_native_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include @@ -5152,7 +5152,7 @@ target_include_directories(dns_resolver_connectivity_using_native_resolver_test ${_gRPC_ZLIB_INCLUDE_DIR} ) -target_link_libraries(dns_resolver_connectivity_using_native_resolver_test +target_link_libraries(dns_resolver_connectivity_using_native_test ${_gRPC_ALLTARGETS_LIBRARIES} grpc_test_util grpc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 33466f4c119..c9030b2fab8 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -3290,7 +3290,7 @@ targets: - address_sorting - upb uses_polling: false -- name: dns_resolver_connectivity_using_ares_resolver_test +- name: dns_resolver_connectivity_using_ares_test build: test language: c headers: [] @@ -3304,7 +3304,7 @@ targets: - upb args: - --resolver=ares -- name: dns_resolver_connectivity_using_native_resolver_test +- name: dns_resolver_connectivity_using_native_test build: test language: c headers: [] diff --git a/test/core/client_channel/resolvers/BUILD b/test/core/client_channel/resolvers/BUILD index 2f965df76f6..ac351fe4286 100644 --- a/test/core/client_channel/resolvers/BUILD +++ b/test/core/client_channel/resolvers/BUILD @@ -19,7 +19,7 @@ grpc_package(name = "test/core/client_channel_resolvers") licenses(["notice"]) # Apache v2 grpc_cc_test( - name = "dns_resolver_connectivity_using_ares_resolver_test", + name = "dns_resolver_connectivity_using_ares_test", srcs = ["dns_resolver_connectivity_test.cc"], args = [ "--resolver=ares", @@ -33,7 +33,7 @@ grpc_cc_test( ) grpc_cc_test( - name = "dns_resolver_connectivity_using_native_resolver_test", + name = "dns_resolver_connectivity_using_native_test", srcs = ["dns_resolver_connectivity_test.cc"], args = [ "--resolver=native", diff --git a/test/cpp/qps/qps_benchmark_script.bzl b/test/cpp/qps/qps_benchmark_script.bzl index 3f461ecc8c5..51b0aefa269 100644 --- a/test/cpp/qps/qps_benchmark_script.bzl +++ b/test/cpp/qps/qps_benchmark_script.bzl @@ -29,10 +29,19 @@ load("//bazel:grpc_build_system.bzl", "grpc_cc_test") load("//test/cpp/qps:qps_json_driver_scenarios.bzl", "QPS_JSON_DRIVER_SCENARIOS") load("//test/cpp/qps:json_run_localhost_scenarios.bzl", "JSON_RUN_LOCALHOST_SCENARIOS") +def add_suffix(name): + # NOTE(https://github.com/grpc/grpc/issues/24178): Add the suffix to the name + # to avoid having the target name that 89 or 90 long. + m = len(name) - (89 - len("//test/cpp/qps:")) + if m == 0 or m == 1: + return name + "_" * (2 - m) + else: + return name + def qps_json_driver_batch(): for scenario in QPS_JSON_DRIVER_SCENARIOS: grpc_cc_test( - name = "qps_json_driver_test_%s" % scenario, + name = add_suffix("qps_json_driver_test_%s" % scenario), srcs = ["qps_json_driver.cc"], args = [ "--run_inproc", @@ -58,7 +67,7 @@ def qps_json_driver_batch(): def json_run_localhost_batch(): for scenario in JSON_RUN_LOCALHOST_SCENARIOS: grpc_cc_test( - name = "json_run_localhost_%s" % scenario, + name = add_suffix("json_run_localhost_%s" % scenario), srcs = ["json_run_localhost.cc"], args = [ "--scenarios_json", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 709e5d2b6ff..1a19005d128 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -874,7 +874,7 @@ "flaky": false, "gtest": false, "language": "c", - "name": "dns_resolver_connectivity_using_ares_resolver_test", + "name": "dns_resolver_connectivity_using_ares_test", "platforms": [ "linux", "mac", @@ -900,7 +900,7 @@ "flaky": false, "gtest": false, "language": "c", - "name": "dns_resolver_connectivity_using_native_resolver_test", + "name": "dns_resolver_connectivity_using_native_test", "platforms": [ "linux", "mac",