1#!/usr/bin/env python2.7 2# Copyright 2015 gRPC authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16""" 17Houses generate_resolver_component_tests. 18""" 19 20load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_test") 21 22# buildifier: disable=unnamed-macro 23def generate_resolver_component_tests(): 24 """Generate address_sorting_test and resolver_component_test suite with different configurations. 25 26 Note that the resolver_component_test suite's configuration is 2 dimensional: security and whether to enable the event_engine_dns experiment. 27 """ 28 for unsecure_build_config_suffix in ["_unsecure", ""]: 29 grpc_cc_test( 30 name = "address_sorting_test%s" % unsecure_build_config_suffix, 31 srcs = [ 32 "address_sorting_test.cc", 33 ], 34 external_deps = [ 35 "gtest", 36 ], 37 deps = [ 38 "//test/cpp/util:test_util%s" % unsecure_build_config_suffix, 39 "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix, 40 "//:grpc++%s" % unsecure_build_config_suffix, 41 "//:grpc%s" % unsecure_build_config_suffix, 42 "//:gpr", 43 "//test/cpp/util:test_config", 44 ], 45 tags = ["no_windows"], 46 ) 47 48 # meant to be invoked only through the top-level shell script driver 49 grpc_cc_binary( 50 name = "resolver_component_test%s" % unsecure_build_config_suffix, 51 testonly = 1, 52 srcs = [ 53 "resolver_component_test.cc", 54 ], 55 external_deps = [ 56 "gtest", 57 ], 58 deps = [ 59 "//test/cpp/util:test_util%s" % unsecure_build_config_suffix, 60 "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix, 61 "//test/core/util:fake_udp_and_tcp_server%s" % unsecure_build_config_suffix, 62 "//test/core/util:socket_use_after_close_detector%s" % unsecure_build_config_suffix, 63 "//:grpc++%s" % unsecure_build_config_suffix, 64 "//:grpc%s" % unsecure_build_config_suffix, 65 "//:gpr", 66 "//src/core:ares_resolver", 67 "//test/cpp/util:test_config", 68 ], 69 tags = ["no_windows"], 70 ) 71 grpc_cc_test( 72 name = "resolver_component_tests_runner_invoker%s" % unsecure_build_config_suffix, 73 srcs = [ 74 "resolver_component_tests_runner_invoker.cc", 75 ], 76 external_deps = [ 77 "absl/flags:flag", 78 "absl/strings", 79 ], 80 deps = [ 81 "//test/cpp/util:test_util%s" % unsecure_build_config_suffix, 82 "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix, 83 "//:grpc++%s" % unsecure_build_config_suffix, 84 "//:grpc%s" % unsecure_build_config_suffix, 85 "//:gpr", 86 "//test/cpp/util:test_config", 87 "//test/cpp/util/windows:manifest_file", 88 ], 89 data = [ 90 ":resolver_component_tests_runner", 91 ":resolver_component_test%s" % unsecure_build_config_suffix, 92 "//test/cpp/naming/utils:dns_server", 93 "//test/cpp/naming/utils:dns_resolver", 94 "//test/cpp/naming/utils:tcp_connect", 95 "//test/cpp/naming:resolver_test_record_groups", # include the transitive dependency so that the dns server py binary can locate this 96 ], 97 args = [ 98 "--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix, 99 "--running_under_bazel=true", 100 ], 101 tags = ["no_mac", "resolver_component_tests_runner_invoker"], 102 ) 103