• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The gRPC Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("@grpc_python_dependencies//:requirements.bzl", "requirement")
16load("@rules_python//python:defs.bzl", "py_binary", "py_test")
17
18py_binary(
19    name = "xds_interop_client",
20    srcs = ["xds_interop_client.py"],
21    python_version = "PY3",
22    # csm_observability dependency was added first because we have another opentelemetry module in xds_protos,
23    # Since we need the actual opentelemetry module, we need include csm_observability before grpc_admin.
24    deps = ["//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability"] + [
25        "//src/proto/grpc/testing:empty_py_pb2",
26        "//src/proto/grpc/testing:py_messages_proto",
27        "//src/proto/grpc/testing:py_test_proto",
28        "//src/proto/grpc/testing:test_py_pb2_grpc",
29        "//src/python/grpcio/grpc:grpcio",
30        "//src/python/grpcio_admin/grpc_admin",
31        "//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz",
32        "//src/python/grpcio_tests/tests/fork:native_debug",
33        requirement("opentelemetry-exporter-prometheus"),
34    ],
35)
36
37py_binary(
38    name = "xds_interop_server",
39    srcs = ["xds_interop_server.py"],
40    python_version = "PY3",
41    deps = [
42        "//src/proto/grpc/testing:empty_py_pb2",
43        "//src/proto/grpc/testing:py_messages_proto",
44        "//src/proto/grpc/testing:py_test_proto",
45        "//src/proto/grpc/testing:test_py_pb2_grpc",
46        "//src/python/grpcio/grpc:grpcio",
47        "//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz",
48        "//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability",
49        "//src/python/grpcio_health_checking/grpc_health/v1:grpc_health",
50        "//src/python/grpcio_reflection/grpc_reflection/v1alpha:grpc_reflection",
51        "//src/python/grpcio_tests/tests/fork:native_debug",
52        requirement("opentelemetry-exporter-prometheus"),
53    ],
54)
55
56py_test(
57    name = "xds_interop_client_test",
58    srcs = ["xds_interop_client_test.py"],
59    imports = ["."],
60    python_version = "PY3",
61    deps = [
62        ":xds_interop_client",
63        ":xds_interop_server",
64        "//src/proto/grpc/testing:empty_py_pb2",
65        "//src/proto/grpc/testing:py_messages_proto",
66        "//src/proto/grpc/testing:py_test_proto",
67        "//src/proto/grpc/testing:test_py_pb2_grpc",
68        "//src/python/grpcio_tests/tests/unit/framework/common",
69    ],
70)
71