Debian Codegraph @

test/cpp/naming/generate_resolver_component_tests.bzl

raw
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 """
17 Houses generate_resolver_component_tests.
18 """
19
20 load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_test")
21
22 # buildifier: disable=unnamed-macro
23 def generate_resolver_component_tests():
24 for unsecure_build_config_suffix in ["_unsecure", ""]:
25 grpc_cc_test(
26 name = "address_sorting_test%s" % unsecure_build_config_suffix,
27 srcs = [
28 "address_sorting_test.cc",
29 ],
30 external_deps = [
31 "gtest",
32 ],
33 deps = [
34 "//test/cpp/util:test_util%s" % unsecure_build_config_suffix,
35 "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix,
36 "//:grpc++%s" % unsecure_build_config_suffix,
37 "//:grpc%s" % unsecure_build_config_suffix,
38 "//:gpr",
39 "//test/cpp/util:test_config",
40 ],
41 tags = ["no_windows"],
42 )
43
44 # meant to be invoked only through the top-level shell script driver
45 grpc_cc_binary(
46 name = "resolver_component_test%s" % unsecure_build_config_suffix,
47 testonly = 1,
48 srcs = [
49 "resolver_component_test.cc",
50 ],
51 external_deps = [
52 "gtest",
53 ],
54 deps = [
55 "//test/cpp/util:test_util%s" % unsecure_build_config_suffix,
56 "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix,
57 "//test/core/util:fake_udp_and_tcp_server",
58 "//:grpc++%s" % unsecure_build_config_suffix,
59 "//:grpc%s" % unsecure_build_config_suffix,
60 "//:gpr",
61 "//test/cpp/util:test_config",
62 ],
63 tags = ["no_windows"],
64 )
65 grpc_cc_test(
66 name = "resolver_component_tests_runner_invoker%s" % unsecure_build_config_suffix,
67 srcs = [
68 "resolver_component_tests_runner_invoker.cc",
69 ],
70 external_deps = [
71 "absl/flags:flag",
72 ],
73 deps = [
74 "//test/cpp/util:test_util",
75 "//test/core/util:grpc_test_util",
76 "//:grpc++",
77 "//:grpc",
78 "//:gpr",
79 "//test/cpp/util:test_config",
80 ],
81 data = [
82 ":resolver_component_tests_runner",
83 ":resolver_component_test%s" % unsecure_build_config_suffix,
84 "//test/cpp/naming/utils:dns_server",
85 "//test/cpp/naming/utils:dns_resolver",
86 "//test/cpp/naming/utils:tcp_connect",
87 "resolver_test_record_groups.yaml", # include the transitive dependency so that the dns sever py binary can locate this
88 ],
89 args = [
90 "--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix,
91 "--running_under_bazel=true",
92 ],
93 # The test is highly flaky on AWS workers that we use for running ARM64 tests.
94 # The "no_arm64" tag can be used to skip it.
95 # (see https://github.com/grpc/grpc/issues/25289).
96 tags = ["no_windows", "no_mac", "no_arm64"],
97 )