From 3b3f4732e86de77922575965004d64e92836f1c0 Mon Sep 17 00:00:00 2001 From: yashykt <4181124+yashykt@users.noreply.github.com> Date: Sat, 11 Jan 2025 02:57:57 +0000 Subject: [PATCH] Automated change: Fix sanity tests --- CMakeLists.txt | 182 +++++++++++++++++++++++++++ build_autogenerated.yaml | 75 +++++++++++ test/core/promise/BUILD | 5 +- tools/run_tests/generated/tests.json | 72 +++++++++++ 4 files changed, 333 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9a9a5b5d9dab..f210ea6f3ce54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1496,6 +1496,7 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx grpc_cli) add_dependencies(buildtests_cxx grpc_completion_queue_test) add_dependencies(buildtests_cxx grpc_ipv6_loopback_available_test) + add_dependencies(buildtests_cxx grpc_text_map_carrier_test) add_dependencies(buildtests_cxx grpc_tls_certificate_distributor_test) add_dependencies(buildtests_cxx grpc_tls_certificate_provider_test) add_dependencies(buildtests_cxx grpc_tls_certificate_verifier_test) @@ -1505,6 +1506,7 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx grpc_tool_test) endif() + add_dependencies(buildtests_cxx grpc_trace_bin_text_map_propagator_test) add_dependencies(buildtests_cxx grpclb_api_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx grpclb_end2end_test) @@ -1624,6 +1626,7 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx orca_service_test) add_dependencies(buildtests_cxx orphanable_test) add_dependencies(buildtests_cxx osa_distance_test) + add_dependencies(buildtests_cxx otel_tracing_test) add_dependencies(buildtests_cxx out_of_bounds_bad_client_test) add_dependencies(buildtests_cxx outlier_detection_lb_config_parser_test) add_dependencies(buildtests_cxx outlier_detection_test) @@ -17747,6 +17750,54 @@ if(gRPC_INSTALL) ) endif() +endif() +if(gRPC_BUILD_TESTS) + +add_executable(grpc_text_map_carrier_test + src/cpp/ext/otel/otel_client_call_tracer.cc + src/cpp/ext/otel/otel_plugin.cc + src/cpp/ext/otel/otel_server_call_tracer.cc + test/cpp/ext/otel/grpc_text_map_carrier_test.cc +) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(grpc_text_map_carrier_test + PRIVATE + "GPR_DLL_IMPORTS" + "GRPC_DLL_IMPORTS" + "GRPCXX_DLL_IMPORTS" + ) + endif() +endif() +target_compile_features(grpc_text_map_carrier_test PUBLIC cxx_std_17) +target_include_directories(grpc_text_map_carrier_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(grpc_text_map_carrier_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + grpc++ + opentelemetry-cpp::api + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) @@ -18145,6 +18196,54 @@ endif() endif() if(gRPC_BUILD_TESTS) +add_executable(grpc_trace_bin_text_map_propagator_test + src/cpp/ext/otel/otel_client_call_tracer.cc + src/cpp/ext/otel/otel_plugin.cc + src/cpp/ext/otel/otel_server_call_tracer.cc + test/cpp/ext/otel/grpc_trace_bin_text_map_propagator_test.cc +) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(grpc_trace_bin_text_map_propagator_test + PRIVATE + "GPR_DLL_IMPORTS" + "GRPC_DLL_IMPORTS" + "GRPCXX_DLL_IMPORTS" + ) + endif() +endif() +target_compile_features(grpc_trace_bin_text_map_propagator_test PUBLIC cxx_std_17) +target_include_directories(grpc_trace_bin_text_map_propagator_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(grpc_trace_bin_text_map_propagator_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + grpc++ + opentelemetry-cpp::api + grpc_test_util +) + + +endif() +if(gRPC_BUILD_TESTS) + add_executable(grpclb_api_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc @@ -23359,6 +23458,89 @@ target_link_libraries(otel_plugin_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(otel_tracing_test + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/google/api/annotations.pb.cc + ${_gRPC_PROTO_GENS_DIR}/google/api/annotations.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/google/api/annotations.pb.h + ${_gRPC_PROTO_GENS_DIR}/google/api/annotations.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/google/api/http.pb.cc + ${_gRPC_PROTO_GENS_DIR}/google/api/http.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/google/api/http.pb.h + ${_gRPC_PROTO_GENS_DIR}/google/api/http.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/google/rpc/status.pb.cc + ${_gRPC_PROTO_GENS_DIR}/google/rpc/status.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/google/rpc/status.pb.h + ${_gRPC_PROTO_GENS_DIR}/google/rpc/status.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/validate/validate.pb.cc + ${_gRPC_PROTO_GENS_DIR}/validate/validate.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/validate/validate.pb.h + ${_gRPC_PROTO_GENS_DIR}/validate/validate.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/xds/data/orca/v3/orca_load_report.pb.cc + ${_gRPC_PROTO_GENS_DIR}/xds/data/orca/v3/orca_load_report.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/xds/data/orca/v3/orca_load_report.pb.h + ${_gRPC_PROTO_GENS_DIR}/xds/data/orca/v3/orca_load_report.grpc.pb.h + src/cpp/ext/otel/otel_client_call_tracer.cc + src/cpp/ext/otel/otel_plugin.cc + src/cpp/ext/otel/otel_server_call_tracer.cc + test/core/test_util/fake_stats_plugin.cc + test/cpp/end2end/test_service_impl.cc + test/cpp/ext/otel/otel_test_library.cc + test/cpp/ext/otel/otel_tracing_test.cc +) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(otel_tracing_test + PRIVATE + "GPR_DLL_IMPORTS" + "GRPC_DLL_IMPORTS" + "GRPCXX_DLL_IMPORTS" + ) + endif() +endif() +target_compile_features(otel_tracing_test PUBLIC cxx_std_17) +target_include_directories(otel_tracing_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(otel_tracing_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + opentelemetry-cpp::api + opentelemetry-cpp::metrics + grpc++_test_util +) + + endif() if(gRPC_BUILD_TESTS) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 7ac76cd1d52b9..c6192f6916843 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -11993,6 +11993,26 @@ targets: - src/compiler/ruby_plugin.cc deps: - grpc_plugin_support +- name: grpc_text_map_carrier_test + gtest: true + build: test + language: c++ + headers: + - src/cpp/ext/otel/key_value_iterable.h + - src/cpp/ext/otel/otel_client_call_tracer.h + - src/cpp/ext/otel/otel_plugin.h + - src/cpp/ext/otel/otel_server_call_tracer.h + - test/core/promise/test_context.h + src: + - src/cpp/ext/otel/otel_client_call_tracer.cc + - src/cpp/ext/otel/otel_plugin.cc + - src/cpp/ext/otel/otel_server_call_tracer.cc + - test/cpp/ext/otel/grpc_text_map_carrier_test.cc + deps: + - gtest + - grpc++ + - opentelemetry-cpp::api + - grpc_test_util - name: grpc_tls_certificate_distributor_test gtest: true build: test @@ -12194,6 +12214,26 @@ targets: platforms: - linux - posix +- name: grpc_trace_bin_text_map_propagator_test + gtest: true + build: test + language: c++ + headers: + - src/cpp/ext/otel/key_value_iterable.h + - src/cpp/ext/otel/otel_client_call_tracer.h + - src/cpp/ext/otel/otel_plugin.h + - src/cpp/ext/otel/otel_server_call_tracer.h + - test/core/promise/test_context.h + src: + - src/cpp/ext/otel/otel_client_call_tracer.cc + - src/cpp/ext/otel/otel_plugin.cc + - src/cpp/ext/otel/otel_server_call_tracer.cc + - test/cpp/ext/otel/grpc_trace_bin_text_map_propagator_test.cc + deps: + - gtest + - grpc++ + - opentelemetry-cpp::api + - grpc_test_util - name: grpclb_api_test gtest: true build: test @@ -15207,6 +15247,7 @@ targets: - src/cpp/ext/otel/otel_client_call_tracer.h - src/cpp/ext/otel/otel_plugin.h - src/cpp/ext/otel/otel_server_call_tracer.h + - test/core/promise/test_context.h - test/core/test_util/fake_stats_plugin.h - test/cpp/end2end/test_service_impl.h - test/cpp/ext/otel/otel_test_library.h @@ -15231,6 +15272,40 @@ targets: - opentelemetry-cpp::api - opentelemetry-cpp::metrics - grpc++_test_util +- name: otel_tracing_test + gtest: true + build: test + language: c++ + headers: + - src/cpp/ext/otel/key_value_iterable.h + - src/cpp/ext/otel/otel_client_call_tracer.h + - src/cpp/ext/otel/otel_plugin.h + - src/cpp/ext/otel/otel_server_call_tracer.h + - test/core/promise/test_context.h + - test/core/test_util/fake_stats_plugin.h + - test/cpp/end2end/test_service_impl.h + - test/cpp/ext/otel/otel_test_library.h + src: + - src/proto/grpc/testing/echo.proto + - src/proto/grpc/testing/echo_messages.proto + - src/proto/grpc/testing/simple_messages.proto + - third_party/googleapis/google/api/annotations.proto + - third_party/googleapis/google/api/http.proto + - third_party/googleapis/google/rpc/status.proto + - third_party/protoc-gen-validate/validate/validate.proto + - third_party/xds/xds/data/orca/v3/orca_load_report.proto + - src/cpp/ext/otel/otel_client_call_tracer.cc + - src/cpp/ext/otel/otel_plugin.cc + - src/cpp/ext/otel/otel_server_call_tracer.cc + - test/core/test_util/fake_stats_plugin.cc + - test/cpp/end2end/test_service_impl.cc + - test/cpp/ext/otel/otel_test_library.cc + - test/cpp/ext/otel/otel_tracing_test.cc + deps: + - gtest + - opentelemetry-cpp::api + - opentelemetry-cpp::metrics + - grpc++_test_util - name: out_of_bounds_bad_client_test gtest: true build: test diff --git a/test/core/promise/BUILD b/test/core/promise/BUILD index 84555b1b2a3d2..cb7e4959b4280 100644 --- a/test/core/promise/BUILD +++ b/test/core/promise/BUILD @@ -43,7 +43,10 @@ grpc_cc_library( name = "test_context", testonly = True, hdrs = ["test_context.h"], - visibility = ["//test/core:__subpackages__", "//test/cpp:__subpackages__"], + visibility = [ + "//test/core:__subpackages__", + "//test/cpp:__subpackages__", + ], deps = ["//src/core:context"], ) diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 0250cfb95cce2..fdc1b827ed896 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -4327,6 +4327,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "grpc_text_map_carrier_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, @@ -4491,6 +4515,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "grpc_trace_bin_text_map_propagator_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, @@ -6697,6 +6745,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "otel_tracing_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false,