• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//bazel:python_rules.bzl", "py2and3_test")
2
3package(default_visibility = ["//visibility:public"])
4
5GRPCIO_TESTS_UNIT = [
6    "_abort_test.py",
7    "_api_test.py",
8    "_auth_context_test.py",
9    "_auth_test.py",
10    "_version_test.py",
11    "_channel_args_test.py",
12    "_channel_close_test.py",
13    "_channel_connectivity_test.py",
14    "_channel_ready_future_test.py",
15    "_compression_test.py",
16    "_contextvars_propagation_test.py",
17    "_credentials_test.py",
18    "_dns_resolver_test.py",
19    "_empty_message_test.py",
20    "_error_message_encoding_test.py",
21    # TODO(https://github.com/grpc/grpc/issues/20385) enable this test
22    # "_exit_test.py",
23    "_grpc_shutdown_test.py",
24    "_interceptor_test.py",
25    "_invalid_metadata_test.py",
26    "_invocation_defects_test.py",
27    "_local_credentials_test.py",
28    "_logging_test.py",
29    "_metadata_flags_test.py",
30    "_metadata_code_details_test.py",
31    "_metadata_test.py",
32    "_reconnect_test.py",
33    "_resource_exhausted_test.py",
34    "_rpc_part_1_test.py",
35    "_rpc_part_2_test.py",
36    "_signal_handling_test.py",
37    # TODO(ghostwriternr): To be added later.
38    # "_server_ssl_cert_config_test.py",
39    "_server_test.py",
40    "_server_shutdown_test.py",
41    "_server_wait_for_termination_test.py",
42    "_session_cache_test.py",
43    "_xds_credentials_test.py",
44]
45
46py_library(
47    name = "_tcp_proxy",
48    srcs = ["_tcp_proxy.py"],
49)
50
51py_library(
52    name = "_signal_client",
53    srcs = ["_signal_client.py"],
54)
55
56py_library(
57    name = "resources",
58    srcs = ["resources.py"],
59    data = [
60        "//src/python/grpcio_tests/tests/unit/credentials",
61    ],
62)
63
64py_library(
65    name = "test_common",
66    srcs = ["test_common.py"],
67)
68
69py_library(
70    name = "thread_pool",
71    srcs = ["thread_pool.py"],
72)
73
74py_library(
75    name = "_exit_scenarios",
76    srcs = ["_exit_scenarios.py"],
77)
78
79py_library(
80    name = "_rpc_test_helpers",
81    srcs = ["_rpc_test_helpers.py"],
82)
83
84py_library(
85    name = "_server_shutdown_scenarios",
86    srcs = ["_server_shutdown_scenarios.py"],
87)
88
89py_library(
90    name = "_from_grpc_import_star",
91    srcs = ["_from_grpc_import_star.py"],
92)
93
94[
95    py2and3_test(
96        name = test_file_name[:-3],
97        size = "small",
98        srcs = [test_file_name],
99        data = [
100            "//src/python/grpcio_tests/tests/unit/credentials",
101        ],
102        imports = ["../../"],
103        main = test_file_name,
104        deps = [
105            ":_exit_scenarios",
106            ":_from_grpc_import_star",
107            ":_rpc_test_helpers",
108            ":_server_shutdown_scenarios",
109            ":_signal_client",
110            ":_tcp_proxy",
111            ":resources",
112            ":test_common",
113            ":thread_pool",
114            "//src/python/grpcio/grpc:grpcio",
115            "//src/python/grpcio_tests/tests/testing",
116            "//src/python/grpcio_tests/tests/unit/framework/common",
117            "@six",
118        ],
119    )
120    for test_file_name in GRPCIO_TESTS_UNIT
121]
122
123py2and3_test(
124    name = "_dynamic_stubs_test",
125    size = "small",
126    srcs = ["_dynamic_stubs_test.py"],
127    data = [
128        "data/foo/bar.proto",
129        "data/foo/bar_with_wkt.proto",
130    ],
131    imports = ["../../"],
132    main = "_dynamic_stubs_test.py",
133    deps = [
134        "//src/python/grpcio/grpc:grpcio",
135        "//src/python/grpcio_tests/tests/testing",
136        "//tools/distrib/python/grpcio_tools:grpc_tools",
137        "@six",
138    ],
139)
140