1# Copyright 2023 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_library", "py_test") 17 18package(default_visibility = ["//visibility:public"]) 19 20py_library( 21 name = "test_server", 22 srcs = ["_test_server.py"], 23) 24 25py_library( 26 name = "_from_observability_import_star", 27 srcs = ["_from_observability_import_star.py"], 28) 29 30py_library( 31 name = "_from_csm_observability_import_star", 32 srcs = ["_from_csm_observability_import_star.py"], 33) 34 35py_test( 36 name = "_open_telemetry_observability_test", 37 size = "small", 38 srcs = ["_open_telemetry_observability_test.py"], 39 imports = ["../../"], 40 main = "_open_telemetry_observability_test.py", 41 deps = [ 42 ":test_server", 43 "//src/python/grpcio/grpc:grpcio", 44 "//src/python/grpcio_observability/grpc_observability:pyobservability", 45 "//src/python/grpcio_tests/tests/testing", 46 requirement("opentelemetry-sdk"), 47 ], 48) 49 50py_test( 51 name = "_observability_plugin_test", 52 size = "small", 53 srcs = ["_observability_plugin_test.py"], 54 imports = ["../../"], 55 main = "_observability_plugin_test.py", 56 deps = [ 57 ":test_server", 58 "//src/python/grpcio/grpc:grpcio", 59 "//src/python/grpcio_observability/grpc_observability:pyobservability", 60 "//src/python/grpcio_tests/tests/testing", 61 requirement("protobuf"), 62 requirement("opentelemetry-sdk"), 63 ], 64) 65 66py_test( 67 name = "_csm_observability_plugin_test", 68 size = "small", 69 srcs = ["_csm_observability_plugin_test.py"], 70 imports = ["../../"], 71 main = "_csm_observability_plugin_test.py", 72 deps = [ 73 ":test_server", 74 "//src/python/grpcio/grpc:grpcio", 75 "//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability", 76 "//src/python/grpcio_tests/tests/testing", 77 requirement("protobuf"), 78 requirement("opentelemetry-sdk"), 79 ], 80) 81 82py_test( 83 name = "_observability_api_test", 84 size = "small", 85 srcs = ["_observability_api_test.py"], 86 imports = ["../../"], 87 main = "_observability_api_test.py", 88 deps = [ 89 ":_from_csm_observability_import_star", 90 ":_from_observability_import_star", 91 "//src/python/grpcio/grpc:grpcio", 92 "//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability", 93 "//src/python/grpcio_observability/grpc_observability:pyobservability", 94 "//src/python/grpcio_tests/tests/testing", 95 ], 96) 97