generate_resolver_component_tests.bzl 3.8 KB

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