diff --git a/CMakeLists.txt b/CMakeLists.txt index d84462bd725..b2a03910b71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1448,7 +1448,7 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx tcp_server_posix_test) endif() add_dependencies(buildtests_cxx tcp_socket_utils_test) - add_dependencies(buildtests_cxx test_core_channel_channelz_test) + add_dependencies(buildtests_cxx test_core_channelz_channelz_test) add_dependencies(buildtests_cxx test_core_end2end_channelz_test) add_dependencies(buildtests_cxx test_core_event_engine_posix_timer_heap_test) add_dependencies(buildtests_cxx test_core_event_engine_posix_timer_list_test) @@ -5897,7 +5897,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) add_executable(static_stride_scheduler_benchmark src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc - test/core/client_channel/lb_policy/static_stride_scheduler_benchmark.cc + test/core/load_balancing/static_stride_scheduler_benchmark.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -8051,7 +8051,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(binder_resolver_test - test/core/client_channel/resolvers/binder_resolver_test.cc + test/core/resolver/binder_resolver_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -9928,7 +9928,7 @@ add_executable(channel_trace_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h - test/core/channel/channel_trace_test.cc + test/core/channelz/channel_trace_test.cc test/cpp/util/channel_trace_proto_helper.cc ) if(WIN32 AND MSVC) @@ -9973,7 +9973,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(channelz_registry_test - test/core/channel/channelz_registry_test.cc + test/core/channelz/channelz_registry_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -12206,7 +12206,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(dns_resolver_cooldown_test - test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc + test/core/resolver/dns_resolver_cooldown_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -12248,7 +12248,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(dns_resolver_test - test/core/client_channel/resolvers/dns_resolver_test.cc + test/core/resolver/dns_resolver_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -13667,7 +13667,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(fake_resolver_test - test/core/client_channel/resolvers/fake_resolver_test.cc + test/core/resolver/fake_resolver_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -14837,7 +14837,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(google_c2p_resolver_test - test/core/client_channel/resolvers/google_c2p_resolver_test.cc + test/core/resolver/google_c2p_resolver_test.cc test/core/util/fake_udp_and_tcp_server.cc ) if(WIN32 AND MSVC) @@ -17183,7 +17183,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(http_proxy_mapper_test - test/core/client_channel/http_proxy_mapper_test.cc + test/core/handshake/http_proxy_mapper_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -20808,7 +20808,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(outlier_detection_lb_config_parser_test - test/core/client_channel/lb_policy/outlier_detection_lb_config_parser_test.cc + test/core/load_balancing/outlier_detection_lb_config_parser_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -20854,9 +20854,9 @@ add_executable(outlier_detection_test ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - test/core/client_channel/lb_policy/outlier_detection_test.cc test/core/event_engine/event_engine_test_utils.cc test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + test/core/load_balancing/outlier_detection_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -21341,9 +21341,9 @@ add_executable(pick_first_test ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - test/core/client_channel/lb_policy/pick_first_test.cc test/core/event_engine/event_engine_test_utils.cc test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + test/core/load_balancing/pick_first_test.cc test/core/util/fake_stats_plugin.cc ) if(WIN32 AND MSVC) @@ -26106,9 +26106,9 @@ add_executable(ring_hash_test ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - test/core/client_channel/lb_policy/ring_hash_test.cc test/core/event_engine/event_engine_test_utils.cc test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + test/core/load_balancing/ring_hash_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -26225,7 +26225,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(rls_lb_config_parser_test - test/core/client_channel/lb_policy/rls_lb_config_parser_test.cc + test/core/load_balancing/rls_lb_config_parser_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -26271,9 +26271,9 @@ add_executable(round_robin_test ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - test/core/client_channel/lb_policy/round_robin_test.cc test/core/event_engine/event_engine_test_utils.cc test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + test/core/load_balancing/round_robin_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -28180,7 +28180,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(sockaddr_resolver_test - test/core/client_channel/resolvers/sockaddr_resolver_test.cc + test/core/resolver/sockaddr_resolver_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -28570,7 +28570,7 @@ if(gRPC_BUILD_TESTS) add_executable(static_stride_scheduler_test src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc - test/core/client_channel/lb_policy/static_stride_scheduler_test.cc + test/core/load_balancing/static_stride_scheduler_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -29558,18 +29558,18 @@ target_link_libraries(tcp_socket_utils_test endif() if(gRPC_BUILD_TESTS) -add_executable(test_core_channel_channelz_test +add_executable(test_core_channelz_channelz_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h - test/core/channel/channelz_test.cc + test/core/channelz/channelz_test.cc test/core/event_engine/event_engine_test_utils.cc test/cpp/util/channel_trace_proto_helper.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) - target_compile_definitions(test_core_channel_channelz_test + target_compile_definitions(test_core_channelz_channelz_test PRIVATE "GPR_DLL_IMPORTS" "GRPC_DLL_IMPORTS" @@ -29577,8 +29577,8 @@ if(WIN32 AND MSVC) ) endif() endif() -target_compile_features(test_core_channel_channelz_test PUBLIC cxx_std_14) -target_include_directories(test_core_channel_channelz_test +target_compile_features(test_core_channelz_channelz_test PUBLIC cxx_std_14) +target_include_directories(test_core_channelz_channelz_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include @@ -29597,7 +29597,7 @@ target_include_directories(test_core_channel_channelz_test ${_gRPC_PROTO_GENS_DIR} ) -target_link_libraries(test_core_channel_channelz_test +target_link_libraries(test_core_channelz_channelz_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest absl::check @@ -32143,7 +32143,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(weighted_round_robin_config_test - test/core/client_channel/lb_policy/weighted_round_robin_config_test.cc + test/core/load_balancing/weighted_round_robin_config_test.cc test/core/util/fake_stats_plugin.cc ) if(WIN32 AND MSVC) @@ -32190,9 +32190,9 @@ add_executable(weighted_round_robin_test ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - test/core/client_channel/lb_policy/weighted_round_robin_test.cc test/core/event_engine/event_engine_test_utils.cc test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + test/core/load_balancing/weighted_round_robin_test.cc test/core/util/fake_stats_plugin.cc ) if(WIN32 AND MSVC) @@ -35551,7 +35551,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(xds_override_host_lb_config_parser_test - test/core/client_channel/lb_policy/xds_override_host_lb_config_parser_test.cc + test/core/load_balancing/xds_override_host_lb_config_parser_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) @@ -35597,9 +35597,9 @@ add_executable(xds_override_host_test ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - test/core/client_channel/lb_policy/xds_override_host_test.cc test/core/event_engine/event_engine_test_utils.cc test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + test/core/load_balancing/xds_override_host_test.cc ) if(WIN32 AND MSVC) if(BUILD_SHARED_LIBS) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 731c17d651a..584b21c2131 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5170,7 +5170,7 @@ targets: - src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h src: - src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc - - test/core/client_channel/lb_policy/static_stride_scheduler_benchmark.cc + - test/core/load_balancing/static_stride_scheduler_benchmark.cc deps: - absl/algorithm:container - absl/types:span @@ -6108,7 +6108,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/resolvers/binder_resolver_test.cc + - test/core/resolver/binder_resolver_test.cc deps: - gtest - grpc_test_util @@ -7576,7 +7576,7 @@ targets: - test/cpp/util/channel_trace_proto_helper.h src: - src/proto/grpc/channelz/channelz.proto - - test/core/channel/channel_trace_test.cc + - test/core/channelz/channel_trace_test.cc - test/cpp/util/channel_trace_proto_helper.cc deps: - gtest @@ -7588,7 +7588,7 @@ targets: language: c++ headers: [] src: - - test/core/channel/channelz_registry_test.cc + - test/core/channelz/channelz_registry_test.cc deps: - gtest - grpc++ @@ -8662,7 +8662,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc + - test/core/resolver/dns_resolver_cooldown_test.cc deps: - gtest - grpc_test_util @@ -8672,7 +8672,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/resolvers/dns_resolver_test.cc + - test/core/resolver/dns_resolver_test.cc deps: - gtest - grpc_test_util @@ -9460,7 +9460,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/resolvers/fake_resolver_test.cc + - test/core/resolver/fake_resolver_test.cc deps: - gtest - grpc_test_util @@ -10267,7 +10267,7 @@ targets: headers: - test/core/util/fake_udp_and_tcp_server.h src: - - test/core/client_channel/resolvers/google_c2p_resolver_test.cc + - test/core/resolver/google_c2p_resolver_test.cc - test/core/util/fake_udp_and_tcp_server.cc deps: - gtest @@ -11405,7 +11405,7 @@ targets: headers: - test/core/util/scoped_env_var.h src: - - test/core/client_channel/http_proxy_mapper_test.cc + - test/core/handshake/http_proxy_mapper_test.cc deps: - gtest - grpc_test_util @@ -13384,7 +13384,7 @@ targets: headers: - test/core/util/scoped_env_var.h src: - - test/core/client_channel/lb_policy/outlier_detection_lb_config_parser_test.cc + - test/core/load_balancing/outlier_detection_lb_config_parser_test.cc deps: - gtest - grpc_test_util @@ -13394,14 +13394,14 @@ targets: build: test language: c++ headers: - - test/core/client_channel/lb_policy/lb_policy_test_lib.h - test/core/event_engine/event_engine_test_utils.h - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h + - test/core/load_balancing/lb_policy_test_lib.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - test/core/client_channel/lb_policy/outlier_detection_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + - test/core/load_balancing/outlier_detection_test.cc deps: - gtest - absl/log:check @@ -13671,16 +13671,16 @@ targets: build: test language: c++ headers: - - test/core/client_channel/lb_policy/lb_policy_test_lib.h - test/core/event_engine/event_engine_test_utils.h - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h + - test/core/load_balancing/lb_policy_test_lib.h - test/core/util/fake_stats_plugin.h - test/core/util/scoped_env_var.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - test/core/client_channel/lb_policy/pick_first_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + - test/core/load_balancing/pick_first_test.cc - test/core/util/fake_stats_plugin.cc deps: - gtest @@ -17182,14 +17182,14 @@ targets: build: test language: c++ headers: - - test/core/client_channel/lb_policy/lb_policy_test_lib.h - test/core/event_engine/event_engine_test_utils.h - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h + - test/core/load_balancing/lb_policy_test_lib.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - test/core/client_channel/lb_policy/ring_hash_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + - test/core/load_balancing/ring_hash_test.cc deps: - gtest - absl/log:check @@ -17230,7 +17230,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/lb_policy/rls_lb_config_parser_test.cc + - test/core/load_balancing/rls_lb_config_parser_test.cc deps: - gtest - grpc_test_util @@ -17240,14 +17240,14 @@ targets: build: test language: c++ headers: - - test/core/client_channel/lb_policy/lb_policy_test_lib.h - test/core/event_engine/event_engine_test_utils.h - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h + - test/core/load_balancing/lb_policy_test_lib.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - test/core/client_channel/lb_policy/round_robin_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + - test/core/load_balancing/round_robin_test.cc deps: - gtest - absl/log:check @@ -18222,7 +18222,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/resolvers/sockaddr_resolver_test.cc + - test/core/resolver/sockaddr_resolver_test.cc deps: - gtest - grpc_test_util @@ -18361,7 +18361,7 @@ targets: - src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h src: - src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc - - test/core/client_channel/lb_policy/static_stride_scheduler_test.cc + - test/core/load_balancing/static_stride_scheduler_test.cc deps: - gtest - absl/types:span @@ -18799,7 +18799,7 @@ targets: - absl/log:check - grpc uses_polling: false -- name: test_core_channel_channelz_test +- name: test_core_channelz_channelz_test gtest: true build: test language: c++ @@ -18808,7 +18808,7 @@ targets: - test/cpp/util/channel_trace_proto_helper.h src: - src/proto/grpc/channelz/channelz.proto - - test/core/channel/channelz_test.cc + - test/core/channelz/channelz_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/cpp/util/channel_trace_proto_helper.cc deps: @@ -19983,7 +19983,7 @@ targets: headers: - test/core/util/fake_stats_plugin.h src: - - test/core/client_channel/lb_policy/weighted_round_robin_config_test.cc + - test/core/load_balancing/weighted_round_robin_config_test.cc - test/core/util/fake_stats_plugin.cc deps: - gtest @@ -19994,15 +19994,15 @@ targets: build: test language: c++ headers: - - test/core/client_channel/lb_policy/lb_policy_test_lib.h - test/core/event_engine/event_engine_test_utils.h - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h + - test/core/load_balancing/lb_policy_test_lib.h - test/core/util/fake_stats_plugin.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - test/core/client_channel/lb_policy/weighted_round_robin_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + - test/core/load_balancing/weighted_round_robin_test.cc - test/core/util/fake_stats_plugin.cc deps: - gtest @@ -21392,7 +21392,7 @@ targets: language: c++ headers: [] src: - - test/core/client_channel/lb_policy/xds_override_host_lb_config_parser_test.cc + - test/core/load_balancing/xds_override_host_lb_config_parser_test.cc deps: - gtest - grpc_test_util @@ -21402,14 +21402,14 @@ targets: build: test language: c++ headers: - - test/core/client_channel/lb_policy/lb_policy_test_lib.h - test/core/event_engine/event_engine_test_utils.h - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h + - test/core/load_balancing/lb_policy_test_lib.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - test/core/client_channel/lb_policy/xds_override_host_test.cc - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc + - test/core/load_balancing/xds_override_host_test.cc deps: - gtest - absl/log:check diff --git a/test/core/channel/BUILD b/test/core/channel/BUILD index dc36704723c..718b0300a0e 100644 --- a/test/core/channel/BUILD +++ b/test/core/channel/BUILD @@ -95,58 +95,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "channel_trace_test", - srcs = ["channel_trace_test.cc"], - external_deps = [ - "gtest", - ], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//:grpc++", - "//src/core:channel_args", - "//test/core/util:grpc_test_util", - "//test/cpp/util:channel_trace_proto_helper", - ], -) - -grpc_cc_test( - name = "channelz_test", - srcs = ["channelz_test.cc"], - external_deps = [ - "gtest", - ], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//:grpc++", - "//src/core:channel_args", - "//test/core/event_engine:event_engine_test_utils", - "//test/core/util:grpc_test_util", - "//test/cpp/util:channel_trace_proto_helper", - ], -) - -grpc_cc_test( - name = "channelz_registry_test", - srcs = ["channelz_registry_test.cc"], - external_deps = [ - "gtest", - ], - language = "C++", - uses_event_engine = False, - uses_polling = False, - deps = [ - "//:gpr", - "//:grpc", - "//:grpc++", - "//test/core/util:grpc_test_util", - ], -) - grpc_cc_test( name = "status_util_test", srcs = ["status_util_test.cc"], diff --git a/test/core/channelz/BUILD b/test/core/channelz/BUILD new file mode 100644 index 00000000000..82c3bde0d30 --- /dev/null +++ b/test/core/channelz/BUILD @@ -0,0 +1,71 @@ +# Copyright 2016 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. + +load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package") + +grpc_package(name = "test/core/channelz") + +licenses(["notice"]) + +grpc_cc_test( + name = "channel_trace_test", + srcs = ["channel_trace_test.cc"], + external_deps = [ + "gtest", + ], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//:grpc++", + "//src/core:channel_args", + "//test/core/util:grpc_test_util", + "//test/cpp/util:channel_trace_proto_helper", + ], +) + +grpc_cc_test( + name = "channelz_test", + srcs = ["channelz_test.cc"], + external_deps = [ + "gtest", + ], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//:grpc++", + "//src/core:channel_args", + "//test/core/event_engine:event_engine_test_utils", + "//test/core/util:grpc_test_util", + "//test/cpp/util:channel_trace_proto_helper", + ], +) + +grpc_cc_test( + name = "channelz_registry_test", + srcs = ["channelz_registry_test.cc"], + external_deps = [ + "gtest", + ], + language = "C++", + uses_event_engine = False, + uses_polling = False, + deps = [ + "//:gpr", + "//:grpc", + "//:grpc++", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/core/channel/channel_trace_test.cc b/test/core/channelz/channel_trace_test.cc similarity index 100% rename from test/core/channel/channel_trace_test.cc rename to test/core/channelz/channel_trace_test.cc diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channelz/channelz_registry_test.cc similarity index 100% rename from test/core/channel/channelz_registry_test.cc rename to test/core/channelz/channelz_registry_test.cc diff --git a/test/core/channel/channelz_test.cc b/test/core/channelz/channelz_test.cc similarity index 100% rename from test/core/channel/channelz_test.cc rename to test/core/channelz/channelz_test.cc diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD index db32f642365..1de1356f7d1 100644 --- a/test/core/client_channel/BUILD +++ b/test/core/client_channel/BUILD @@ -33,21 +33,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "http_proxy_mapper_test", - srcs = ["http_proxy_mapper_test.cc"], - external_deps = ["gtest"], - language = "C++", - uses_polling = False, - deps = [ - "//:gpr", - "//:grpc", - "//src/core:channel_args", - "//test/core/util:grpc_test_util", - "//test/core/util:scoped_env_var", - ], -) - grpc_cc_test( name = "retry_throttle_test", srcs = ["retry_throttle_test.cc"], diff --git a/test/core/client_channel/resolvers/BUILD b/test/core/client_channel/resolvers/BUILD deleted file mode 100644 index c6ff60d95d2..00000000000 --- a/test/core/client_channel/resolvers/BUILD +++ /dev/null @@ -1,104 +0,0 @@ -# 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. - -load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package") - -grpc_package(name = "test/core/client_channel/resolvers") - -licenses(["notice"]) - -grpc_cc_test( - name = "binder_resolver_test", - srcs = ["binder_resolver_test.cc"], - external_deps = [ - "gtest", - ], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//src/core:grpc_resolver_binder", - "//test/core/util:grpc_test_util", - ], -) - -grpc_cc_test( - name = "dns_resolver_test", - srcs = ["dns_resolver_test.cc"], - external_deps = ["gtest"], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], -) - -grpc_cc_test( - name = "dns_resolver_cooldown_test", - srcs = ["dns_resolver_cooldown_test.cc"], - external_deps = ["gtest"], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//src/core:channel_args", - "//src/core:closure", - "//test/core/util:grpc_test_util", - ], -) - -grpc_cc_test( - name = "sockaddr_resolver_test", - srcs = ["sockaddr_resolver_test.cc"], - external_deps = ["gtest"], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], -) - -grpc_cc_test( - name = "fake_resolver_test", - srcs = ["fake_resolver_test.cc"], - external_deps = ["gtest"], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//:grpc_resolver_fake", - "//src/core:channel_args", - "//test/core/util:grpc_test_util", - ], -) - -grpc_cc_test( - name = "google_c2p_resolver_test", - srcs = ["google_c2p_resolver_test.cc"], - external_deps = [ - "absl/strings:str_format", - "gtest", - ], - language = "C++", - deps = [ - "//:gpr", - "//:grpc", - "//:grpc++", - "//test/core/util:fake_udp_and_tcp_server", - "//test/core/util:grpc_test_util", - "//test/cpp/util:test_util", - ], -) diff --git a/test/core/handshake/BUILD b/test/core/handshake/BUILD index 749afb50ab3..ded4fbd4a48 100644 --- a/test/core/handshake/BUILD +++ b/test/core/handshake/BUILD @@ -105,3 +105,18 @@ grpc_cc_test( # "//test/core/util:grpc_test_util", # ], #) + +grpc_cc_test( + name = "http_proxy_mapper_test", + srcs = ["http_proxy_mapper_test.cc"], + external_deps = ["gtest"], + language = "C++", + uses_polling = False, + deps = [ + "//:gpr", + "//:grpc", + "//src/core:channel_args", + "//test/core/util:grpc_test_util", + "//test/core/util:scoped_env_var", + ], +) diff --git a/test/core/client_channel/http_proxy_mapper_test.cc b/test/core/handshake/http_proxy_mapper_test.cc similarity index 100% rename from test/core/client_channel/http_proxy_mapper_test.cc rename to test/core/handshake/http_proxy_mapper_test.cc diff --git a/test/core/client_channel/lb_policy/BUILD b/test/core/load_balancing/BUILD similarity index 99% rename from test/core/client_channel/lb_policy/BUILD rename to test/core/load_balancing/BUILD index 292fe932664..304e91c1325 100644 --- a/test/core/client_channel/lb_policy/BUILD +++ b/test/core/load_balancing/BUILD @@ -19,7 +19,7 @@ load( "grpc_package", ) -grpc_package(name = "test/core/client_channel/lb_policy") +grpc_package(name = "test/core/load_balancing") licenses(["notice"]) diff --git a/test/core/client_channel/lb_policy/lb_policy_test_lib.h b/test/core/load_balancing/lb_policy_test_lib.h similarity index 99% rename from test/core/client_channel/lb_policy/lb_policy_test_lib.h rename to test/core/load_balancing/lb_policy_test_lib.h index 3f42dbba0bf..9f2e0b113cd 100644 --- a/test/core/client_channel/lb_policy/lb_policy_test_lib.h +++ b/test/core/load_balancing/lb_policy_test_lib.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef GRPC_TEST_CORE_CLIENT_CHANNEL_LB_POLICY_LB_POLICY_TEST_LIB_H -#define GRPC_TEST_CORE_CLIENT_CHANNEL_LB_POLICY_LB_POLICY_TEST_LIB_H +#ifndef GRPC_TEST_CORE_LOAD_BALANCING_LB_POLICY_TEST_LIB_H +#define GRPC_TEST_CORE_LOAD_BALANCING_LB_POLICY_TEST_LIB_H #include #include @@ -1510,4 +1510,4 @@ class LoadBalancingPolicyTest : public ::testing::Test { } // namespace testing } // namespace grpc_core -#endif // GRPC_TEST_CORE_CLIENT_CHANNEL_LB_POLICY_LB_POLICY_TEST_LIB_H +#endif // GRPC_TEST_CORE_LOAD_BALANCING_LB_POLICY_TEST_LIB_H diff --git a/test/core/client_channel/lb_policy/outlier_detection_lb_config_parser_test.cc b/test/core/load_balancing/outlier_detection_lb_config_parser_test.cc similarity index 100% rename from test/core/client_channel/lb_policy/outlier_detection_lb_config_parser_test.cc rename to test/core/load_balancing/outlier_detection_lb_config_parser_test.cc diff --git a/test/core/client_channel/lb_policy/outlier_detection_test.cc b/test/core/load_balancing/outlier_detection_test.cc similarity index 99% rename from test/core/client_channel/lb_policy/outlier_detection_test.cc rename to test/core/load_balancing/outlier_detection_test.cc index 1dbb5476037..d78af4b3d28 100644 --- a/test/core/client_channel/lb_policy/outlier_detection_test.cc +++ b/test/core/load_balancing/outlier_detection_test.cc @@ -42,7 +42,7 @@ #include "src/core/load_balancing/backend_metric_data.h" #include "src/core/load_balancing/lb_policy.h" #include "src/core/resolver/endpoint_addresses.h" -#include "test/core/client_channel/lb_policy/lb_policy_test_lib.h" +#include "test/core/load_balancing/lb_policy_test_lib.h" #include "test/core/util/test_config.h" namespace grpc_core { diff --git a/test/core/client_channel/lb_policy/pick_first_test.cc b/test/core/load_balancing/pick_first_test.cc similarity index 99% rename from test/core/client_channel/lb_policy/pick_first_test.cc rename to test/core/load_balancing/pick_first_test.cc index cb717cb483e..f6961047d4e 100644 --- a/test/core/client_channel/lb_policy/pick_first_test.cc +++ b/test/core/load_balancing/pick_first_test.cc @@ -48,7 +48,7 @@ #include "src/core/lib/json/json.h" #include "src/core/load_balancing/lb_policy.h" #include "src/core/resolver/endpoint_addresses.h" -#include "test/core/client_channel/lb_policy/lb_policy_test_lib.h" +#include "test/core/load_balancing/lb_policy_test_lib.h" #include "test/core/util/fake_stats_plugin.h" #include "test/core/util/test_config.h" diff --git a/test/core/client_channel/lb_policy/ring_hash_test.cc b/test/core/load_balancing/ring_hash_test.cc similarity index 99% rename from test/core/client_channel/lb_policy/ring_hash_test.cc rename to test/core/load_balancing/ring_hash_test.cc index a8739678e07..4f7493f70b7 100644 --- a/test/core/client_channel/lb_policy/ring_hash_test.cc +++ b/test/core/load_balancing/ring_hash_test.cc @@ -39,7 +39,7 @@ #include "src/core/lib/json/json.h" #include "src/core/load_balancing/lb_policy.h" #include "src/core/resolver/endpoint_addresses.h" -#include "test/core/client_channel/lb_policy/lb_policy_test_lib.h" +#include "test/core/load_balancing/lb_policy_test_lib.h" #include "test/core/util/test_config.h" namespace grpc_core { diff --git a/test/core/client_channel/lb_policy/rls_lb_config_parser_test.cc b/test/core/load_balancing/rls_lb_config_parser_test.cc similarity index 100% rename from test/core/client_channel/lb_policy/rls_lb_config_parser_test.cc rename to test/core/load_balancing/rls_lb_config_parser_test.cc diff --git a/test/core/client_channel/lb_policy/round_robin_test.cc b/test/core/load_balancing/round_robin_test.cc similarity index 99% rename from test/core/client_channel/lb_policy/round_robin_test.cc rename to test/core/load_balancing/round_robin_test.cc index 9af35ed951d..219049dff86 100644 --- a/test/core/client_channel/lb_policy/round_robin_test.cc +++ b/test/core/load_balancing/round_robin_test.cc @@ -27,7 +27,7 @@ #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/resolver/endpoint_addresses.h" -#include "test/core/client_channel/lb_policy/lb_policy_test_lib.h" +#include "test/core/load_balancing/lb_policy_test_lib.h" #include "test/core/util/test_config.h" namespace grpc_core { diff --git a/test/core/client_channel/lb_policy/static_stride_scheduler_benchmark.cc b/test/core/load_balancing/static_stride_scheduler_benchmark.cc similarity index 100% rename from test/core/client_channel/lb_policy/static_stride_scheduler_benchmark.cc rename to test/core/load_balancing/static_stride_scheduler_benchmark.cc diff --git a/test/core/client_channel/lb_policy/static_stride_scheduler_test.cc b/test/core/load_balancing/static_stride_scheduler_test.cc similarity index 100% rename from test/core/client_channel/lb_policy/static_stride_scheduler_test.cc rename to test/core/load_balancing/static_stride_scheduler_test.cc diff --git a/test/core/client_channel/lb_policy/weighted_round_robin_config_test.cc b/test/core/load_balancing/weighted_round_robin_config_test.cc similarity index 100% rename from test/core/client_channel/lb_policy/weighted_round_robin_config_test.cc rename to test/core/load_balancing/weighted_round_robin_config_test.cc diff --git a/test/core/client_channel/lb_policy/weighted_round_robin_test.cc b/test/core/load_balancing/weighted_round_robin_test.cc similarity index 99% rename from test/core/client_channel/lb_policy/weighted_round_robin_test.cc rename to test/core/load_balancing/weighted_round_robin_test.cc index 9e8cd2c66d1..38293b9d93d 100644 --- a/test/core/client_channel/lb_policy/weighted_round_robin_test.cc +++ b/test/core/load_balancing/weighted_round_robin_test.cc @@ -50,7 +50,7 @@ #include "src/core/load_balancing/lb_policy.h" #include "src/core/load_balancing/weighted_target/weighted_target.h" #include "src/core/resolver/endpoint_addresses.h" -#include "test/core/client_channel/lb_policy/lb_policy_test_lib.h" +#include "test/core/load_balancing/lb_policy_test_lib.h" #include "test/core/util/fake_stats_plugin.h" #include "test/core/util/test_config.h" diff --git a/test/core/client_channel/lb_policy/xds_override_host_lb_config_parser_test.cc b/test/core/load_balancing/xds_override_host_lb_config_parser_test.cc similarity index 100% rename from test/core/client_channel/lb_policy/xds_override_host_lb_config_parser_test.cc rename to test/core/load_balancing/xds_override_host_lb_config_parser_test.cc diff --git a/test/core/client_channel/lb_policy/xds_override_host_test.cc b/test/core/load_balancing/xds_override_host_test.cc similarity index 99% rename from test/core/client_channel/lb_policy/xds_override_host_test.cc rename to test/core/load_balancing/xds_override_host_test.cc index e6c74b7b2f1..1a177fc907b 100644 --- a/test/core/client_channel/lb_policy/xds_override_host_test.cc +++ b/test/core/load_balancing/xds_override_host_test.cc @@ -46,7 +46,7 @@ #include "src/core/load_balancing/lb_policy.h" #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/xds/xds_dependency_manager.h" -#include "test/core/client_channel/lb_policy/lb_policy_test_lib.h" +#include "test/core/load_balancing/lb_policy_test_lib.h" #include "test/core/util/test_config.h" namespace grpc_core { diff --git a/test/core/resolver/BUILD b/test/core/resolver/BUILD index 04aaf120a8d..020644df369 100644 --- a/test/core/resolver/BUILD +++ b/test/core/resolver/BUILD @@ -1,4 +1,4 @@ -# Copyright 2023 gRPC authors. +# 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. @@ -32,3 +32,88 @@ grpc_cc_test( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "binder_resolver_test", + srcs = ["binder_resolver_test.cc"], + external_deps = [ + "gtest", + ], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//src/core:grpc_resolver_binder", + "//test/core/util:grpc_test_util", + ], +) + +grpc_cc_test( + name = "dns_resolver_test", + srcs = ["dns_resolver_test.cc"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + ], +) + +grpc_cc_test( + name = "dns_resolver_cooldown_test", + srcs = ["dns_resolver_cooldown_test.cc"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//src/core:channel_args", + "//src/core:closure", + "//test/core/util:grpc_test_util", + ], +) + +grpc_cc_test( + name = "sockaddr_resolver_test", + srcs = ["sockaddr_resolver_test.cc"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + ], +) + +grpc_cc_test( + name = "fake_resolver_test", + srcs = ["fake_resolver_test.cc"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//:grpc_resolver_fake", + "//src/core:channel_args", + "//test/core/util:grpc_test_util", + ], +) + +grpc_cc_test( + name = "google_c2p_resolver_test", + srcs = ["google_c2p_resolver_test.cc"], + external_deps = [ + "absl/strings:str_format", + "gtest", + ], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//:grpc++", + "//test/core/util:fake_udp_and_tcp_server", + "//test/core/util:grpc_test_util", + "//test/cpp/util:test_util", + ], +) diff --git a/test/core/client_channel/resolvers/binder_resolver_test.cc b/test/core/resolver/binder_resolver_test.cc similarity index 100% rename from test/core/client_channel/resolvers/binder_resolver_test.cc rename to test/core/resolver/binder_resolver_test.cc diff --git a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc b/test/core/resolver/dns_resolver_cooldown_test.cc similarity index 100% rename from test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc rename to test/core/resolver/dns_resolver_cooldown_test.cc diff --git a/test/core/client_channel/resolvers/dns_resolver_test.cc b/test/core/resolver/dns_resolver_test.cc similarity index 100% rename from test/core/client_channel/resolvers/dns_resolver_test.cc rename to test/core/resolver/dns_resolver_test.cc diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/resolver/fake_resolver_test.cc similarity index 100% rename from test/core/client_channel/resolvers/fake_resolver_test.cc rename to test/core/resolver/fake_resolver_test.cc diff --git a/test/core/client_channel/resolvers/google_c2p_resolver_test.cc b/test/core/resolver/google_c2p_resolver_test.cc similarity index 100% rename from test/core/client_channel/resolvers/google_c2p_resolver_test.cc rename to test/core/resolver/google_c2p_resolver_test.cc diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/resolver/sockaddr_resolver_test.cc similarity index 100% rename from test/core/client_channel/resolvers/sockaddr_resolver_test.cc rename to test/core/resolver/sockaddr_resolver_test.cc diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 15ad36dca3e..1503f00d037 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -10238,7 +10238,7 @@ "flaky": false, "gtest": true, "language": "c++", - "name": "test_core_channel_channelz_test", + "name": "test_core_channelz_channelz_test", "platforms": [ "linux", "mac",