Merge remote-tracking branch 'upstream/master' into backward-compat-dev

pull/11118/head
Muxi Yan 8 years ago
commit bc60bb25b2
  1. 371
      BUILD
  2. 8
      CMakeLists.txt
  3. 8
      Makefile
  4. 4
      WORKSPACE
  5. 66
      bazel/grpc_build_system.bzl
  6. 4
      build.yaml
  7. 175
      doc/unit_testing.md
  8. 4
      examples/BUILD
  9. 2
      gRPC-Core.podspec
  10. 2
      grpc.gemspec
  11. 2
      include/grpc/impl/codegen/grpc_types.h
  12. 2
      package.xml
  13. 7
      src/compiler/config.h
  14. 15
      src/compiler/cpp_generator.cc
  15. 2
      src/core/lib/channel/channel_args.c
  16. 2
      src/core/lib/iomgr/error.c
  17. 687
      src/core/lib/surface/completion_queue.c
  18. 12
      src/core/lib/surface/completion_queue.h
  19. 12
      src/csharp/Grpc.Core/Grpc.Core.csproj
  20. 24
      src/csharp/Grpc.Tools.nuspec
  21. 21
      src/csharp/build_packages_dotnetcli.bat
  22. 28
      src/csharp/build_packages_dotnetcli.sh
  23. 10
      src/proto/grpc/testing/BUILD
  24. 4
      src/proto/grpc/testing/control.proto
  25. 6
      src/proto/grpc/testing/stats.proto
  26. 3
      src/python/grpcio_tests/setup.py
  27. 38
      src/python/grpcio_tests/tests/interop/client.py
  28. 27
      src/python/grpcio_tests/tests/interop/methods.py
  29. 21
      templates/src/csharp/build_packages_dotnetcli.bat.template
  30. 28
      templates/src/csharp/build_packages_dotnetcli.sh.template
  31. 2
      test/core/bad_client/BUILD
  32. 4
      test/core/bad_client/tests/large_metadata.c
  33. 2
      test/core/bad_ssl/BUILD
  34. 18
      test/core/census/BUILD
  35. 10
      test/core/channel/BUILD
  36. 28
      test/core/client_channel/BUILD
  37. 18
      test/core/client_channel/resolvers/BUILD
  38. 14
      test/core/compression/BUILD
  39. 22
      test/core/end2end/BUILD
  40. 45
      test/core/end2end/fuzzers/BUILD
  41. 25
      test/core/end2end/generate_tests.bzl
  42. 60
      test/core/fling/BUILD
  43. 10
      test/core/handshake/BUILD
  44. 70
      test/core/http/BUILD
  45. 237
      test/core/iomgr/BUILD
  46. 69
      test/core/json/BUILD
  47. 31
      test/core/nanopb/BUILD
  48. 13
      test/core/network_benchmarks/BUILD
  49. 94
      test/core/security/BUILD
  50. 61
      test/core/slice/BUILD
  51. 173
      test/core/support/BUILD
  52. 54
      test/core/surface/BUILD
  53. 79
      test/core/transport/BUILD
  54. 101
      test/core/transport/chttp2/BUILD
  55. 13
      test/core/tsi/BUILD
  56. 40
      test/core/util/BUILD
  57. 4
      test/core/util/grpc_fuzzer.bzl
  58. 28
      test/cpp/codegen/BUILD
  59. 54
      test/cpp/common/BUILD
  60. 130
      test/cpp/end2end/BUILD
  61. 3
      test/cpp/end2end/async_end2end_test.cc
  62. 3
      test/cpp/end2end/client_crash_test.cc
  63. 3
      test/cpp/end2end/end2end_test.cc
  64. 3
      test/cpp/end2end/filter_end2end_test.cc
  65. 3
      test/cpp/end2end/generic_end2end_test.cc
  66. 3
      test/cpp/end2end/health_service_end2end_test.cc
  67. 3
      test/cpp/end2end/hybrid_end2end_test.cc
  68. 3
      test/cpp/end2end/mock_test.cc
  69. 3
      test/cpp/end2end/proto_server_reflection_test.cc
  70. 3
      test/cpp/end2end/round_robin_end2end_test.cc
  71. 3
      test/cpp/end2end/server_builder_plugin_test.cc
  72. 3
      test/cpp/end2end/server_crash_test.cc
  73. 4
      test/cpp/end2end/shutdown_test.cc
  74. 4
      test/cpp/end2end/streaming_throughput_test.cc
  75. 4
      test/cpp/end2end/test_service_impl.cc
  76. 3
      test/cpp/end2end/thread_stress_test.cc
  77. 39
      test/cpp/microbenchmarks/BUILD
  78. 16
      test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
  79. 14
      test/cpp/microbenchmarks/fullstack_fixtures.h
  80. 41
      test/cpp/qps/BUILD
  81. 15
      test/cpp/qps/client.h
  82. 8
      test/cpp/qps/client_async.cc
  83. 1
      test/cpp/qps/client_sync.cc
  84. 7
      test/cpp/qps/driver.cc
  85. 1
      test/cpp/qps/qps_json_driver.cc
  86. 21
      test/cpp/qps/report.cc
  87. 7
      test/cpp/qps/report.h
  88. 14
      test/cpp/qps/server.h
  89. 8
      test/cpp/qps/server_async.cc
  90. 65
      test/cpp/util/BUILD
  91. 2
      test/distrib/csharp/run_distrib_test.bat
  92. 2
      tools/dockerfile/test/cxx_alpine_x64/Dockerfile
  93. 4
      tools/doxygen/Doxyfile.c++
  94. 2
      tools/doxygen/Doxyfile.c++.internal
  95. 1
      tools/doxygen/Doxyfile.core
  96. 1
      tools/doxygen/Doxyfile.core.internal
  97. 318
      tools/grpcz/census.proto
  98. 185
      tools/grpcz/grpcz_client.cc
  99. 156
      tools/grpcz/monitoring.proto
  100. 4
      tools/internal_ci/helper_scripts/prepare_build_linux_rc
  101. Some files were not shown because too many files have changed in this diff Show More

371
BUILD

@ -33,13 +33,19 @@ licenses(["notice"]) # 3-clause BSD
exports_files(["LICENSE"])
package(default_visibility = ["//visibility:public"])
package(
default_visibility = ["//visibility:public"],
features = [
"-layering_check",
"-parse_headers",
],
)
load(
"//bazel:grpc_build_system.bzl",
"grpc_cc_library",
"grpc_proto_plugin",
"grpc_cc_libraries",
"grpc_generate_one_off_targets",
)
# This should be updated along with build.yaml
@ -58,48 +64,35 @@ grpc_cc_library(
],
)
grpc_cc_libraries(
grpc_cc_library(
name = "grpc_unsecure",
srcs = [
"src/core/lib/surface/init.c",
],
additional_dep_list = [
[
"grpc_secure",
"grpc_resolver_dns_ares",
"grpc_lb_policy_grpclb_secure",
"grpc_transport_chttp2_client_secure",
"grpc_transport_chttp2_server_secure",
],
[],
],
additional_src_list = [
[
"src/core/plugin_registry/grpc_plugin_registry.c",
],
[
"src/core/lib/surface/init_unsecure.c",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.c",
],
"src/core/lib/surface/init_unsecure.c",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.c",
],
language = "c",
name_list = [
"grpc",
"grpc_unsecure",
standalone = True,
deps = [
"grpc_common",
],
)
grpc_cc_library(
name = "grpc",
srcs = [
"src/core/lib/surface/init.c",
"src/core/plugin_registry/grpc_plugin_registry.c",
],
language = "c",
standalone = True,
deps = [
"census",
"grpc_base",
"grpc_deadline_filter",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_round_robin",
"grpc_load_reporting",
"grpc_max_age_filter",
"grpc_message_size_filter",
"grpc_resolver_dns_native",
"grpc_resolver_sockaddr",
"grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_server_insecure",
"grpc_common",
"grpc_lb_policy_grpclb_secure",
"grpc_resolver_dns_ares",
"grpc_secure",
"grpc_transport_chttp2_client_secure",
"grpc_transport_chttp2_server_secure",
],
)
@ -479,11 +472,10 @@ grpc_cc_library(
"src/core/lib/iomgr/endpoint_pair_windows.c",
"src/core/lib/iomgr/error.c",
"src/core/lib/iomgr/ev_epoll1_linux.c",
"src/core/lib/iomgr/ev_epollsig_linux.c",
"src/core/lib/iomgr/ev_epollex_linux.c",
"src/core/lib/iomgr/is_epollexclusive_available.c",
"src/core/lib/iomgr/ev_epoll_thread_pool_linux.c",
"src/core/lib/iomgr/ev_epoll_limited_pollers_linux.c",
"src/core/lib/iomgr/ev_epoll_thread_pool_linux.c",
"src/core/lib/iomgr/ev_epollex_linux.c",
"src/core/lib/iomgr/ev_epollsig_linux.c",
"src/core/lib/iomgr/ev_poll_posix.c",
"src/core/lib/iomgr/ev_posix.c",
"src/core/lib/iomgr/exec_ctx.c",
@ -493,6 +485,7 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr_posix.c",
"src/core/lib/iomgr/iomgr_uv.c",
"src/core/lib/iomgr/iomgr_windows.c",
"src/core/lib/iomgr/is_epollexclusive_available.c",
"src/core/lib/iomgr/load_file.c",
"src/core/lib/iomgr/lockfree_event.c",
"src/core/lib/iomgr/network_status_tracker.c",
@ -528,8 +521,8 @@ grpc_cc_library(
"src/core/lib/iomgr/tcp_windows.c",
"src/core/lib/iomgr/time_averaged_stats.c",
"src/core/lib/iomgr/timer_generic.c",
"src/core/lib/iomgr/timer_manager.c",
"src/core/lib/iomgr/timer_heap.c",
"src/core/lib/iomgr/timer_manager.c",
"src/core/lib/iomgr/timer_uv.c",
"src/core/lib/iomgr/udp_server.c",
"src/core/lib/iomgr/unix_sockets_posix.c",
@ -605,12 +598,10 @@ grpc_cc_library(
"src/core/lib/iomgr/error.h",
"src/core/lib/iomgr/error_internal.h",
"src/core/lib/iomgr/ev_epoll1_linux.h",
"src/core/lib/iomgr/ev_epollsig_linux.h",
"src/core/lib/iomgr/ev_epollex_linux.h",
"src/core/lib/iomgr/is_epollexclusive_available.h",
"src/core/lib/iomgr/sys_epoll_wrapper.h",
"src/core/lib/iomgr/ev_epoll_thread_pool_linux.h",
"src/core/lib/iomgr/ev_epoll_limited_pollers_linux.h",
"src/core/lib/iomgr/ev_epoll_thread_pool_linux.h",
"src/core/lib/iomgr/ev_epollex_linux.h",
"src/core/lib/iomgr/ev_epollsig_linux.h",
"src/core/lib/iomgr/ev_poll_posix.h",
"src/core/lib/iomgr/ev_posix.h",
"src/core/lib/iomgr/exec_ctx.h",
@ -619,6 +610,7 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr.h",
"src/core/lib/iomgr/iomgr_internal.h",
"src/core/lib/iomgr/iomgr_posix.h",
"src/core/lib/iomgr/is_epollexclusive_available.h",
"src/core/lib/iomgr/load_file.h",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/network_status_tracker.h",
@ -640,6 +632,7 @@ grpc_cc_library(
"src/core/lib/iomgr/socket_utils.h",
"src/core/lib/iomgr/socket_utils_posix.h",
"src/core/lib/iomgr/socket_windows.h",
"src/core/lib/iomgr/sys_epoll_wrapper.h",
"src/core/lib/iomgr/tcp_client.h",
"src/core/lib/iomgr/tcp_client_posix.h",
"src/core/lib/iomgr/tcp_posix.h",
@ -650,8 +643,8 @@ grpc_cc_library(
"src/core/lib/iomgr/time_averaged_stats.h",
"src/core/lib/iomgr/timer.h",
"src/core/lib/iomgr/timer_generic.h",
"src/core/lib/iomgr/timer_manager.h",
"src/core/lib/iomgr/timer_heap.h",
"src/core/lib/iomgr/timer_manager.h",
"src/core/lib/iomgr/timer_uv.h",
"src/core/lib/iomgr/udp_server.h",
"src/core/lib/iomgr/unix_sockets_posix.h",
@ -713,6 +706,7 @@ grpc_cc_library(
"include/grpc/slice.h",
"include/grpc/slice_buffer.h",
"include/grpc/status.h",
"include/grpc/support/workaround_list.h",
],
deps = [
"gpr_base",
@ -723,12 +717,33 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_base",
language = "c++",
srcs = [
"src/core/lib/surface/lame_client.cc",
],
language = "c++",
deps = [
"grpc_base_c",
],
)
grpc_cc_library(
name = "grpc_common",
deps = [
"grpc_base",
# standard plugins
"census",
"grpc_deadline_filter",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_round_robin",
"grpc_load_reporting",
"grpc_max_age_filter",
"grpc_message_size_filter",
"grpc_resolver_dns_native",
"grpc_resolver_sockaddr",
"grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_server_insecure",
"grpc_workaround_cronet_compression_filter",
"grpc_server_backward_compatibility",
]
)
@ -844,6 +859,21 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "grpc_workaround_cronet_compression_filter",
srcs = [
"src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c",
],
hdrs = [
"src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h",
],
language = "c",
deps = [
"grpc_base",
"grpc_server_backward_compatibility",
],
)
grpc_cc_library(
name = "grpc_codegen",
language = "c",
@ -1270,111 +1300,124 @@ grpc_cc_library(
],
)
grpc_cc_libraries(
srcs = [
"src/cpp/client/channel_cc.cc",
"src/cpp/client/client_context.cc",
"src/cpp/client/create_channel.cc",
"src/cpp/client/create_channel_internal.cc",
"src/cpp/client/create_channel_posix.cc",
"src/cpp/client/credentials_cc.cc",
"src/cpp/client/generic_stub.cc",
"src/cpp/common/channel_arguments.cc",
"src/cpp/common/channel_filter.cc",
"src/cpp/common/completion_queue_cc.cc",
"src/cpp/common/core_codegen.cc",
"src/cpp/common/resource_quota_cc.cc",
"src/cpp/common/rpc_method.cc",
"src/cpp/common/version_cc.cc",
"src/cpp/server/async_generic_service.cc",
"src/cpp/server/channel_argument_option.cc",
"src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/dynamic_thread_pool.cc",
"src/cpp/server/health/default_health_check_service.cc",
"src/cpp/server/health/health.pb.c",
"src/cpp/server/health/health_check_service.cc",
"src/cpp/server/health/health_check_service_server_builder_option.cc",
"src/cpp/server/server_builder.cc",
"src/cpp/server/server_cc.cc",
"src/cpp/server/server_context.cc",
"src/cpp/server/server_credentials.cc",
"src/cpp/server/server_posix.cc",
"src/cpp/thread_manager/thread_manager.cc",
"src/cpp/util/byte_buffer_cc.cc",
"src/cpp/util/slice_cc.cc",
"src/cpp/util/status.cc",
"src/cpp/util/string_ref.cc",
"src/cpp/util/time_cc.cc",
],
hdrs = [
"src/cpp/client/create_channel_internal.h",
"src/cpp/common/channel_filter.h",
"src/cpp/server/dynamic_thread_pool.h",
"src/cpp/server/health/default_health_check_service.h",
"src/cpp/server/health/health.pb.h",
"src/cpp/server/thread_pool_interface.h",
"src/cpp/thread_manager/thread_manager.h",
],
additional_dep_list = [
["grpc"],
["grpc_unsecure"],
],
# TODO(ctiller): layer grpc atop grpc_unsecure, layer grpc++ atop grpc++_unsecure
GRPCXX_SRCS = [
"src/cpp/client/channel_cc.cc",
"src/cpp/client/client_context.cc",
"src/cpp/client/create_channel.cc",
"src/cpp/client/create_channel_internal.cc",
"src/cpp/client/create_channel_posix.cc",
"src/cpp/client/credentials_cc.cc",
"src/cpp/client/generic_stub.cc",
"src/cpp/common/channel_arguments.cc",
"src/cpp/common/channel_filter.cc",
"src/cpp/common/completion_queue_cc.cc",
"src/cpp/common/core_codegen.cc",
"src/cpp/common/resource_quota_cc.cc",
"src/cpp/common/rpc_method.cc",
"src/cpp/common/version_cc.cc",
"src/cpp/server/async_generic_service.cc",
"src/cpp/server/channel_argument_option.cc",
"src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/dynamic_thread_pool.cc",
"src/cpp/server/health/default_health_check_service.cc",
"src/cpp/server/health/health.pb.c",
"src/cpp/server/health/health_check_service.cc",
"src/cpp/server/health/health_check_service_server_builder_option.cc",
"src/cpp/server/server_builder.cc",
"src/cpp/server/server_cc.cc",
"src/cpp/server/server_context.cc",
"src/cpp/server/server_credentials.cc",
"src/cpp/server/server_posix.cc",
"src/cpp/thread_manager/thread_manager.cc",
"src/cpp/util/byte_buffer_cc.cc",
"src/cpp/util/slice_cc.cc",
"src/cpp/util/status.cc",
"src/cpp/util/string_ref.cc",
"src/cpp/util/time_cc.cc",
]
GRPCXX_HDRS = [
"src/cpp/client/create_channel_internal.h",
"src/cpp/common/channel_filter.h",
"src/cpp/server/dynamic_thread_pool.h",
"src/cpp/server/health/default_health_check_service.h",
"src/cpp/server/health/health.pb.h",
"src/cpp/server/thread_pool_interface.h",
"src/cpp/thread_manager/thread_manager.h",
]
GRPCXX_PUBLIC_HDRS = [
"include/grpc++/alarm.h",
"include/grpc++/channel.h",
"include/grpc++/client_context.h",
"include/grpc++/completion_queue.h",
"include/grpc++/create_channel.h",
"include/grpc++/create_channel_posix.h",
"include/grpc++/ext/health_check_service_server_builder_option.h",
"include/grpc++/generic/async_generic_service.h",
"include/grpc++/generic/generic_stub.h",
"include/grpc++/grpc++.h",
"include/grpc++/health_check_service_interface.h",
"include/grpc++/impl/call.h",
"include/grpc++/impl/channel_argument_option.h",
"include/grpc++/impl/client_unary_call.h",
"include/grpc++/impl/codegen/core_codegen.h",
"include/grpc++/impl/grpc_library.h",
"include/grpc++/impl/method_handler_impl.h",
"include/grpc++/impl/rpc_method.h",
"include/grpc++/impl/rpc_service_method.h",
"include/grpc++/impl/serialization_traits.h",
"include/grpc++/impl/server_builder_option.h",
"include/grpc++/impl/server_builder_plugin.h",
"include/grpc++/impl/server_initializer.h",
"include/grpc++/impl/service_type.h",
"include/grpc++/impl/sync_cxx11.h",
"include/grpc++/impl/sync_no_cxx11.h",
"include/grpc++/resource_quota.h",
"include/grpc++/security/auth_context.h",
"include/grpc++/security/auth_metadata_processor.h",
"include/grpc++/security/credentials.h",
"include/grpc++/security/server_credentials.h",
"include/grpc++/server.h",
"include/grpc++/server_builder.h",
"include/grpc++/server_context.h",
"include/grpc++/server_posix.h",
"include/grpc++/support/async_stream.h",
"include/grpc++/support/async_unary_call.h",
"include/grpc++/support/byte_buffer.h",
"include/grpc++/support/channel_arguments.h",
"include/grpc++/support/config.h",
"include/grpc++/support/slice.h",
"include/grpc++/support/status.h",
"include/grpc++/support/status_code_enum.h",
"include/grpc++/support/string_ref.h",
"include/grpc++/support/stub_options.h",
"include/grpc++/support/sync_stream.h",
"include/grpc++/support/time.h",
]
grpc_cc_library(
name = "grpc++_base",
hdrs = GRPCXX_HDRS,
srcs = GRPCXX_SRCS,
public_hdrs = GRPCXX_PUBLIC_HDRS,
language = "c++",
name_list = [
"grpc++_base",
"grpc++_base_unsecure",
],
public_hdrs = [
"include/grpc++/alarm.h",
"include/grpc++/channel.h",
"include/grpc++/client_context.h",
"include/grpc++/completion_queue.h",
"include/grpc++/create_channel.h",
"include/grpc++/create_channel_posix.h",
"include/grpc++/ext/health_check_service_server_builder_option.h",
"include/grpc++/generic/async_generic_service.h",
"include/grpc++/generic/generic_stub.h",
"include/grpc++/grpc++.h",
"include/grpc++/health_check_service_interface.h",
"include/grpc++/impl/call.h",
"include/grpc++/impl/channel_argument_option.h",
"include/grpc++/impl/client_unary_call.h",
"include/grpc++/impl/codegen/core_codegen.h",
"include/grpc++/impl/grpc_library.h",
"include/grpc++/impl/method_handler_impl.h",
"include/grpc++/impl/rpc_method.h",
"include/grpc++/impl/rpc_service_method.h",
"include/grpc++/impl/serialization_traits.h",
"include/grpc++/impl/server_builder_option.h",
"include/grpc++/impl/server_builder_plugin.h",
"include/grpc++/impl/server_initializer.h",
"include/grpc++/impl/service_type.h",
"include/grpc++/impl/sync_cxx11.h",
"include/grpc++/impl/sync_no_cxx11.h",
"include/grpc++/resource_quota.h",
"include/grpc++/security/auth_context.h",
"include/grpc++/security/auth_metadata_processor.h",
"include/grpc++/security/credentials.h",
"include/grpc++/security/server_credentials.h",
"include/grpc++/server.h",
"include/grpc++/server_builder.h",
"include/grpc++/server_context.h",
"include/grpc++/server_posix.h",
"include/grpc++/support/async_stream.h",
"include/grpc++/support/async_unary_call.h",
"include/grpc++/support/byte_buffer.h",
"include/grpc++/support/channel_arguments.h",
"include/grpc++/support/config.h",
"include/grpc++/support/slice.h",
"include/grpc++/support/status.h",
"include/grpc++/support/status_code_enum.h",
"include/grpc++/support/string_ref.h",
"include/grpc++/support/stub_options.h",
"include/grpc++/support/sync_stream.h",
"include/grpc++/support/time.h",
deps = [
"grpc++_codegen_base",
"grpc",
],
)
grpc_cc_library(
name = "grpc++_base_unsecure",
hdrs = GRPCXX_HDRS,
srcs = GRPCXX_SRCS,
public_hdrs = GRPCXX_PUBLIC_HDRS,
language = "c++",
deps = [
"grpc++_codegen_base",
"grpc_unsecure",
],
)
@ -1469,3 +1512,31 @@ grpc_cc_library(
"//src/proto/grpc/reflection/v1alpha:reflection_proto",
],
)
grpc_cc_library(
name = "grpc++_test",
public_hdrs = [
"include/grpc++/test/mock_stream.h",
"include/grpc++/test/server_context_test_spouse.h",
],
deps = [
":grpc++",
],
)
grpc_cc_library(
name = "grpc_server_backward_compatibility",
srcs = [
"src/core/ext/filters/workarounds/workaround_utils.c",
],
hdrs = [
"src/core/ext/filters/workarounds/workaround_utils.h",
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_generate_one_off_targets()

@ -850,7 +850,6 @@ foreach(_hdr
include/grpc/support/tls_msvc.h
include/grpc/support/tls_pthread.h
include/grpc/support/useful.h
include/grpc/support/workaround_list.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -1217,6 +1216,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
include/grpc/impl/codegen/byte_buffer_reader.h
include/grpc/impl/codegen/compression_types.h
include/grpc/impl/codegen/connectivity_state.h
@ -1514,6 +1514,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
include/grpc/impl/codegen/byte_buffer_reader.h
include/grpc/impl/codegen/compression_types.h
include/grpc/impl/codegen/connectivity_state.h
@ -1748,6 +1749,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
include/grpc/impl/codegen/byte_buffer_reader.h
include/grpc/impl/codegen/compression_types.h
include/grpc/impl/codegen/connectivity_state.h
@ -2099,6 +2101,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
include/grpc/impl/codegen/byte_buffer_reader.h
include/grpc/impl/codegen/compression_types.h
include/grpc/impl/codegen/connectivity_state.h
@ -2539,6 +2542,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
include/grpc++/impl/codegen/proto_utils.h
include/grpc++/impl/codegen/config_protobuf.h
)
@ -2937,6 +2941,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
include/grpc/census.h
)
string(REPLACE "include/" "" _path ${_hdr})
@ -3644,6 +3649,7 @@ foreach(_hdr
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
include/grpc/support/workaround_list.h
)
string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH)

@ -2822,7 +2822,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/tls_msvc.h \
include/grpc/support/tls_pthread.h \
include/grpc/support/useful.h \
include/grpc/support/workaround_list.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -3157,6 +3156,7 @@ PUBLIC_HEADERS_C += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
@ -3454,6 +3454,7 @@ PUBLIC_HEADERS_C += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
@ -3687,6 +3688,7 @@ PUBLIC_HEADERS_C += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
@ -4011,6 +4013,7 @@ PUBLIC_HEADERS_C += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
@ -4424,6 +4427,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
include/grpc++/impl/codegen/proto_utils.h \
include/grpc++/impl/codegen/config_protobuf.h \
@ -4830,6 +4834,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
include/grpc/census.h \
LIBGRPC++_CRONET_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_CRONET_SRC))))
@ -5528,6 +5533,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
LIBGRPC++_UNSECURE_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_UNSECURE_SRC))))

@ -5,7 +5,7 @@ bind(
bind(
name = "libssl",
actual = "@submodule_boringssl//:ssl",
actual = "@boringssl//:ssl",
)
bind(
@ -49,7 +49,7 @@ bind(
)
local_repository(
name = "submodule_boringssl",
name = "boringssl",
path = "third_party/boringssl-with-bazel",
)

@ -32,8 +32,15 @@
# the BUILD file for gRPC. It contains the mapping for the template system we
# use to generate other platform's build system files.
#
# Please consider that there should be a high bar for additions and changes to
# this file.
# Each rule listed must be re-written for Google's internal build system, and
# each change must be ported from one to the other.
#
def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [], external_deps = [], deps = [], standalone = False, language = "C++"):
def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
external_deps = [], deps = [], standalone = False,
language = "C++", testonly = False, visibility = None):
copts = []
if language.upper() == "C":
copts = ["-std=c99"]
@ -43,28 +50,14 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [], external_deps
hdrs = hdrs + public_hdrs,
deps = deps + ["//external:" + dep for dep in external_deps],
copts = copts,
visibility = visibility,
testonly = testonly,
linkopts = ["-pthread"],
includes = [
"include"
]
)
def grpc_cc_libraries(name_list, additional_src_list = [], additional_dep_list = [], srcs = [], public_hdrs = [], hdrs = [], external_deps = [], deps = [], standalone = False, language="C++"):
names = len(name_list)
asl = additional_src_list + [[]]*(names - len(additional_src_list))
adl = additional_dep_list + [[]]*(names - len(additional_dep_list))
for i in range(names):
grpc_cc_library(
name = name_list[i],
srcs = srcs + asl[i],
hdrs = hdrs,
public_hdrs = public_hdrs,
deps = deps + adl[i],
external_deps = external_deps,
standalone = standalone,
language = language
)
def grpc_proto_plugin(name, srcs = [], deps = []):
native.cc_binary(
name = name,
@ -86,3 +79,42 @@ def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None,
generate_mock = generate_mock,
)
def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++"):
copts = []
if language.upper() == "C":
copts = ["-std=c99"]
native.cc_test(
name = name,
srcs = srcs,
args = args,
data = data,
deps = deps + ["//external:" + dep for dep in external_deps],
copts = copts,
linkopts = ["-pthread"],
)
def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False):
copts = []
if language.upper() == "C":
copts = ["-std=c99"]
native.cc_binary(
name = name,
srcs = srcs,
args = args,
data = data,
testonly = testonly,
linkshared = linkshared,
deps = deps + ["//external:" + dep for dep in external_deps],
copts = copts,
linkopts = ["-pthread"],
)
def grpc_generate_one_off_targets():
pass
def grpc_sh_test(name, srcs, args = [], data = []):
native.sh_test(
name = name,
srcs = srcs,
args = args,
data = data)

@ -83,7 +83,6 @@ filegroups:
- include/grpc/support/tls_msvc.h
- include/grpc/support/tls_pthread.h
- include/grpc/support/useful.h
- include/grpc/support/workaround_list.h
headers:
- src/core/lib/profiling/timers.h
- src/core/lib/support/arena.h
@ -177,6 +176,7 @@ filegroups:
- include/grpc/slice.h
- include/grpc/slice_buffer.h
- include/grpc/status.h
- include/grpc/support/workaround_list.h
headers:
- src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h
@ -3364,7 +3364,7 @@ targets:
- gpr_test_util
- gpr
args:
- --benchmark_min_time=0
- --benchmark_min_time=4
defaults: benchmark
platforms:
- mac

@ -0,0 +1,175 @@
# How to write unit tests for gRPC C client.
tl;dr: [Example code](https://github.com/grpc/grpc/blob/master/test/cpp/end2end/mock_test.cc).
To unit-test client-side logic via the synchronous API, gRPC provides a mocked Stub based on googletest(googlemock) that can be programmed upon and easily incorporated in the test code.
For instance, consider an EchoService like this:
```proto
service EchoTestService {
rpc Echo(EchoRequest) returns (EchoResponse);
rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
}
```
The code generated would look something like this:
```c
class EchoTestService final {
public:
class StubInterface {
virtual ::grpc::Status Echo(::grpc::ClientContext* context, const ::grpc::testing::EchoRequest& request, ::grpc::testing::EchoResponse* response) = 0;
std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::testing::EchoRequest, ::grpc::testing::EchoResponse>> BidiStream(::grpc::ClientContext* context) {
return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::testing::EchoRequest, ::grpc::testing::EchoResponse>>(BidiStreamRaw(context));
}
private:
virtual ::grpc::ClientReaderWriterInterface< ::grpc::testing::EchoRequest, ::grpc::testing::EchoResponse>* BidiStreamRaw(::grpc::ClientContext* context) = 0;
} // End StubInterface
} // End EchoTestService
```
If we mock the StubInterface and set expectations on the pure-virtual methods we can test client-side logic without having to make any rpcs.
A mock for this StubInterface will look like this:
```c
class MockEchoTestServiceStub : public EchoTestService::StubInterface {
public:
MOCK_METHOD3(Echo, ::grpc::Status(::grpc::ClientContext* context, const ::grpc::testing::EchoRequest& request, ::grpc::testing::EchoResponse* response));
MOCK_METHOD1(BidiStreamRaw, ::grpc::ClientReaderWriterInterface< ::grpc::testing::EchoRequest, ::grpc::testing::EchoResponse>*(::grpc::ClientContext* context));
};
```
**Generating mock code:**
Such a mock can be auto-generated by:
1. Setting flag(generate_mock_code=true) on grpc plugin for protoc, or
1. Setting an attribute(generate_mock) in your bazel rule.
Protoc plugin flag:
```sh
protoc -I . --grpc_out=generate_mock_code=true:. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` echo.proto
```
Bazel rule:
```py
grpc_proto_library(
name = "echo_proto",
srcs = ["echo.proto"],
generate_mock = True,
)
```
By adding such a flag now a header file `echo_mock.grpc.pb.h` containing the mocked stub will also be generated.
This header file can then be included in test files along with a gmock dependency.
**Writing tests with mocked Stub.**
Consider the following client a user might have:
```c
class FakeClient {
public:
explicit FakeClient(EchoTestService::StubInterface* stub) : stub_(stub) {}
void DoEcho() {
ClientContext context;
EchoRequest request;
EchoResponse response;
request.set_message("hello world");
Status s = stub_->Echo(&context, request, &response);
EXPECT_EQ(request.message(), response.message());
EXPECT_TRUE(s.ok());
}
void DoBidiStream() {
EchoRequest request;
EchoResponse response;
ClientContext context;
grpc::string msg("hello");
std::unique_ptr<ClientReaderWriterInterface<EchoRequest, EchoResponse>>
stream = stub_->BidiStream(&context);
request.set_message(msg "0");
EXPECT_TRUE(stream->Write(request));
EXPECT_TRUE(stream->Read(&response));
EXPECT_EQ(response.message(), request.message());
request.set_message(msg "1");
EXPECT_TRUE(stream->Write(request));
EXPECT_TRUE(stream->Read(&response));
EXPECT_EQ(response.message(), request.message());
request.set_message(msg "2");
EXPECT_TRUE(stream->Write(request));
EXPECT_TRUE(stream->Read(&response));
EXPECT_EQ(response.message(), request.message());
stream->WritesDone();
EXPECT_FALSE(stream->Read(&response));
Status s = stream->Finish();
EXPECT_TRUE(s.ok());
}
void ResetStub(EchoTestService::StubInterface* stub) { stub_ = stub; }
private:
EchoTestService::StubInterface* stub_;
};
```
A test could initialize this FakeClient with a mocked stub having set expectations on it:
Unary RPC:
```c
MockEchoTestServiceStub stub;
EchoResponse resp;
resp.set_message("hello world");
Expect_CALL(stub, Echo(_,_,_)).Times(Atleast(1)).WillOnce(DoAll(SetArgPointee<2>(resp), Return(Status::OK)));
FakeClient client(stub);
client.DoEcho();
```
Streaming RPC:
```c
ACTION_P(copy, msg) {
arg0->set_message(msg->message());
}
auto rw = new MockClientReaderWriter<EchoRequest, EchoResponse>();
EchoRequest msg;
EXPECT_CALL(*rw, Write(_, _)).Times(3).WillRepeatedly(DoAll(SaveArg<0>(&msg), Return(true)));
EXPECT_CALL(*rw, Read(_)).
WillOnce(DoAll(WithArg<0>(copy(&msg)), Return(true))).
WillOnce(DoAll(WithArg<0>(copy(&msg)), Return(true))).
WillOnce(DoAll(WithArg<0>(copy(&msg)), Return(true))).
WillOnce(Return(false));
MockEchoTestServiceStub stub;
EXPECT_CALL(stub, BidiStreamRaw(_)).Times(AtLeast(1)).WillOnce(Return(rw));
FakeClient client(stub);
client.DoBidiStream();
```

@ -54,13 +54,13 @@ grpc_proto_library(
cc_binary(
name = "greeter_client",
srcs = ["cpp/helloworld/greeter_client.cc"],
deps = ["helloworld"],
defines = ["BAZEL_BUILD"],
deps = [":helloworld"],
)
cc_binary(
name = "greeter_server",
srcs = ["cpp/helloworld/greeter_server.cc"],
deps = ["helloworld"],
defines = ["BAZEL_BUILD"],
deps = [":helloworld"],
)

@ -145,7 +145,6 @@ Pod::Spec.new do |s|
'include/grpc/support/tls_msvc.h',
'include/grpc/support/tls_pthread.h',
'include/grpc/support/useful.h',
'include/grpc/support/workaround_list.h',
'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h',
@ -167,6 +166,7 @@ Pod::Spec.new do |s|
'include/grpc/slice.h',
'include/grpc/slice_buffer.h',
'include/grpc/status.h',
'include/grpc/support/workaround_list.h',
'include/grpc/impl/codegen/byte_buffer_reader.h',
'include/grpc/impl/codegen/compression_types.h',
'include/grpc/impl/codegen/connectivity_state.h',

@ -69,7 +69,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/tls_msvc.h )
s.files += %w( include/grpc/support/tls_pthread.h )
s.files += %w( include/grpc/support/useful.h )
s.files += %w( include/grpc/support/workaround_list.h )
s.files += %w( include/grpc/impl/codegen/atm.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
@ -155,6 +154,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/slice.h )
s.files += %w( include/grpc/slice_buffer.h )
s.files += %w( include/grpc/status.h )
s.files += %w( include/grpc/support/workaround_list.h )
s.files += %w( include/grpc/impl/codegen/byte_buffer_reader.h )
s.files += %w( include/grpc/impl/codegen/compression_types.h )
s.files += %w( include/grpc/impl/codegen/connectivity_state.h )

@ -592,7 +592,7 @@ typedef enum {
/** Specifies the type of APIs to use to pop events from the completion queue */
typedef enum {
/** Events are popped out by calling grpc_completion_queue_next() API ONLY */
GRPC_CQ_NEXT = 1,
GRPC_CQ_NEXT,
/** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
GRPC_CQ_PLUCK

@ -78,7 +78,6 @@
<file baseinstalldir="/" name="include/grpc/support/tls_msvc.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/tls_pthread.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/useful.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/workaround_list.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" />
@ -164,6 +163,7 @@
<file baseinstalldir="/" name="include/grpc/slice.h" role="src" />
<file baseinstalldir="/" name="include/grpc/slice_buffer.h" role="src" />
<file baseinstalldir="/" name="include/grpc/status.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/workaround_list.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/byte_buffer_reader.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/compression_types.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/connectivity_state.h" role="src" />

@ -96,4 +96,11 @@ typedef GRPC_CUSTOM_STRINGOUTPUTSTREAM StringOutputStream;
} // namespace protobuf
} // namespace grpc
namespace grpc_cpp_generator {
static const char* const kCppGeneratorMessageHeaderExt = ".pb.h";
static const char* const kCppGeneratorServiceHeaderExt = ".grpc.pb.h";
} // namespace grpc_cpp_generator
#endif // SRC_COMPILER_CONFIG_H

@ -40,9 +40,6 @@
namespace grpc_cpp_generator {
namespace {
grpc::string message_header_ext() { return ".pb.h"; }
grpc::string service_header_ext() { return ".grpc.pb.h"; }
template <class T>
grpc::string as_string(T x) {
std::ostringstream out;
@ -113,7 +110,7 @@ grpc::string GetHeaderPrologue(grpc_generator::File *file,
vars["filename"] = file->filename();
vars["filename_identifier"] = FilenameIdentifier(file->filename());
vars["filename_base"] = file->filename_without_ext();
vars["message_header_ext"] = message_header_ext();
vars["message_header_ext"] = kCppGeneratorMessageHeaderExt;
printer->Print(vars, "// Generated by the gRPC C++ plugin.\n");
printer->Print(vars,
@ -128,6 +125,7 @@ grpc::string GetHeaderPrologue(grpc_generator::File *file,
printer->Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n");
printer->Print(vars, "\n");
printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n");
printer->Print(vars, file->additional_headers().c_str());
printer->Print(vars, "\n");
}
return output;
@ -1039,8 +1037,8 @@ grpc::string GetSourcePrologue(grpc_generator::File *file,
vars["filename"] = file->filename();
vars["filename_base"] = file->filename_without_ext();
vars["message_header_ext"] = message_header_ext();
vars["service_header_ext"] = service_header_ext();
vars["message_header_ext"] = kCppGeneratorMessageHeaderExt;
vars["service_header_ext"] = kCppGeneratorServiceHeaderExt;
printer->Print(vars, "// Generated by the gRPC C++ plugin.\n");
printer->Print(vars,
@ -1049,7 +1047,6 @@ grpc::string GetSourcePrologue(grpc_generator::File *file,
printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n");
printer->Print(vars, "#include \"$filename_base$$service_header_ext$\"\n");
printer->Print(vars, file->additional_headers().c_str());
printer->Print(vars, "\n");
}
return output;
@ -1425,8 +1422,8 @@ grpc::string GetMockPrologue(grpc_generator::File *file,
vars["filename"] = file->filename();
vars["filename_base"] = file->filename_without_ext();
vars["message_header_ext"] = message_header_ext();
vars["service_header_ext"] = service_header_ext();
vars["message_header_ext"] = kCppGeneratorMessageHeaderExt;
vars["service_header_ext"] = kCppGeneratorServiceHeaderExt;
printer->Print(vars, "// Generated by the gRPC C++ plugin.\n");
printer->Print(vars,

@ -31,6 +31,8 @@
*
*/
#include <grpc/support/port_platform.h>
#include <limits.h>
#include <string.h>

@ -769,7 +769,7 @@ grpc_error *grpc_os_error(const char *file, int line, int err,
GRPC_ERROR_INT_ERRNO, err),
GRPC_ERROR_STR_OS_ERROR,
grpc_slice_from_static_string(strerror(err))),
GRPC_ERROR_STR_SYSCALL, grpc_slice_from_static_string(call_name));
GRPC_ERROR_STR_SYSCALL, grpc_slice_from_copied_string(call_name));
}
#ifdef GPR_WINDOWS

File diff suppressed because it is too large Load Diff

@ -49,7 +49,13 @@ extern grpc_tracer_flag grpc_trace_operation_failures;
extern grpc_tracer_flag grpc_trace_pending_tags;
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct grpc_cq_completion {
gpr_mpscq_node node;
/** user supplied tag */
void *tag;
/** done callback - called when this queue element is no longer
@ -101,7 +107,13 @@ bool grpc_cq_can_listen(grpc_completion_queue *cc);
grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cc);
int grpc_get_cq_poll_num(grpc_completion_queue *cc);
grpc_completion_queue *grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */

@ -19,27 +19,27 @@
<ItemGroup>
<EmbeddedResource Include="..\..\..\etc\roots.pem" />
<Content Include="..\nativelibs\macosx_x64\libgrpc_csharp_ext.dylib">
<Content Include="..\nativelibs\csharp_ext_macos_x64\libgrpc_csharp_ext.dylib">
<PackagePath>runtimes/osx/native/libgrpc_csharp_ext.x64.dylib</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\nativelibs\macosx_x86\libgrpc_csharp_ext.dylib">
<Content Include="..\nativelibs\csharp_ext_macos_x86\libgrpc_csharp_ext.dylib">
<PackagePath>runtimes/osx/native/libgrpc_csharp_ext.x86.dylib</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\nativelibs\linux_x64\libgrpc_csharp_ext.so">
<Content Include="..\nativelibs\csharp_ext_linux_x64\libgrpc_csharp_ext.so">
<PackagePath>runtimes/linux/native/libgrpc_csharp_ext.x64.so</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\nativelibs\linux_x86\libgrpc_csharp_ext.so">
<Content Include="..\nativelibs\csharp_ext_linux_x86\libgrpc_csharp_ext.so">
<PackagePath>runtimes/linux/native/libgrpc_csharp_ext.x86.so</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\nativelibs\windows_x64\grpc_csharp_ext.dll">
<Content Include="..\nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll">
<PackagePath>runtimes/win/native/grpc_csharp_ext.x64.dll</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\nativelibs\windows_x86\grpc_csharp_ext.dll">
<Content Include="..\nativelibs\csharp_ext_windows_x86\grpc_csharp_ext.dll">
<PackagePath>runtimes/win/native/grpc_csharp_ext.x86.dll</PackagePath>
<Pack>true</Pack>
</Content>

@ -17,17 +17,17 @@
</metadata>
<files>
<!-- forward slashes in src path enable building on Linux -->
<file src="protoc_plugins/windows_x86/protoc.exe" target="tools/windows_x86/protoc.exe" />
<file src="protoc_plugins/windows_x86/grpc_csharp_plugin.exe" target="tools/windows_x86/grpc_csharp_plugin.exe" />
<file src="protoc_plugins/windows_x64/protoc.exe" target="tools/windows_x64/protoc.exe" />
<file src="protoc_plugins/windows_x64/grpc_csharp_plugin.exe" target="tools/windows_x64/grpc_csharp_plugin.exe" />
<file src="protoc_plugins/linux_x86/protoc" target="tools/linux_x86/protoc" />
<file src="protoc_plugins/linux_x86/grpc_csharp_plugin" target="tools/linux_x86/grpc_csharp_plugin" />
<file src="protoc_plugins/linux_x64/protoc" target="tools/linux_x64/protoc" />
<file src="protoc_plugins/linux_x64/grpc_csharp_plugin" target="tools/linux_x64/grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x86/protoc" target="tools/macosx_x86/protoc" />
<file src="protoc_plugins/macosx_x86/grpc_csharp_plugin" target="tools/macosx_x86/grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x64/protoc" target="tools/macosx_x64/protoc" />
<file src="protoc_plugins/macosx_x64/grpc_csharp_plugin" target="tools/macosx_x64/grpc_csharp_plugin" />
<file src="protoc_plugins/protoc_windows_x86/protoc.exe" target="tools/windows_x86/protoc.exe" />
<file src="protoc_plugins/protoc_windows_x86/grpc_csharp_plugin.exe" target="tools/windows_x86/grpc_csharp_plugin.exe" />
<file src="protoc_plugins/protoc_windows_x64/protoc.exe" target="tools/windows_x64/protoc.exe" />
<file src="protoc_plugins/protoc_windows_x64/grpc_csharp_plugin.exe" target="tools/windows_x64/grpc_csharp_plugin.exe" />
<file src="protoc_plugins/protoc_linux_x86/protoc" target="tools/linux_x86/protoc" />
<file src="protoc_plugins/protoc_linux_x86/grpc_csharp_plugin" target="tools/linux_x86/grpc_csharp_plugin" />
<file src="protoc_plugins/protoc_linux_x64/protoc" target="tools/linux_x64/protoc" />
<file src="protoc_plugins/protoc_linux_x64/grpc_csharp_plugin" target="tools/linux_x64/grpc_csharp_plugin" />
<file src="protoc_plugins/protoc_macos_x86/protoc" target="tools/macosx_x86/protoc" />
<file src="protoc_plugins/protoc_macos_x86/grpc_csharp_plugin" target="tools/macosx_x86/grpc_csharp_plugin" />
<file src="protoc_plugins/protoc_macos_x64/protoc" target="tools/macosx_x64/protoc" />
<file src="protoc_plugins/protoc_macos_x64/grpc_csharp_plugin" target="tools/macosx_x64/grpc_csharp_plugin" />
</files>
</package>

@ -36,29 +36,20 @@ set DOTNET=dotnet
set -ex
mkdir -p ..\..\artifacts\
mkdir ..\..\artifacts
@rem Collect the artifacts built by the previous build step if running on Jenkins
@rem TODO(jtattermusch): is there a better way to do this?
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* nativelibs\windows_x86\
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* nativelibs\windows_x64\
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* nativelibs\linux_x86\
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* nativelibs\linux_x64\
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x86\
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x64\
mkdir nativelibs
powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs"
@rem Collect protoc artifacts built by the previous build step
xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86\
xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64\
xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86\
xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64\
xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86\
xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64\
mkdir protoc_plugins
powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins"
%DOTNET% restore Grpc.sln || goto :error
@rem To be able to build, we also need to put grpc_csharp_ext to its normal location
xcopy /Y /I nativelibs\windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release\
xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release\
%DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error
%DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error

@ -34,35 +34,19 @@ cd $(dirname $0)
mkdir -p ../../artifacts/
mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \
nativelibs/linux_x86 nativelibs/linux_x64 \
nativelibs/macosx_x86 nativelibs/macosx_x64
mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 \
protoc_plugins/linux_x86 protoc_plugins/linux_x64 \
protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
# Collect the artifacts built by the previous build step if running on Jenkins
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
# Collect the artifacts built by the previous build step
mkdir -p nativelibs
cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/csharp_ext_* nativelibs || true
# Collect protoc artifacts built by the previous build step
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
mkdir -p protoc_plugins
cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/protoc_* protoc_plugins || true
dotnet restore Grpc.sln
# To be able to build, we also need to put grpc_csharp_ext to its normal location
mkdir -p ../../libs/opt
cp nativelibs/linux_x64/libgrpc_csharp_ext.so ../../libs/opt
cp nativelibs/csharp_ext_linux_x64/libgrpc_csharp_ext.so ../../libs/opt
dotnet pack --configuration Release Grpc.Core --output ../../../artifacts
dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts

@ -42,8 +42,11 @@ grpc_proto_library(
grpc_proto_library(
name = "control_proto",
srcs = ["control.proto"],
deps = ["payloads_proto", "stats_proto"],
has_services = False,
deps = [
"payloads_proto",
"stats_proto",
],
)
grpc_proto_library(
@ -101,5 +104,8 @@ grpc_proto_library(
grpc_proto_library(
name = "test_proto",
srcs = ["test.proto"],
deps = ["empty_proto", "messages_proto"],
deps = [
"empty_proto",
"messages_proto",
],
)

@ -244,6 +244,10 @@ message ScenarioResultSummary
// Number of requests that succeeded/failed
double successful_requests_per_second = 13;
double failed_requests_per_second = 14;
// Number of polls called inside completion queue per request
double client_polls_per_request = 15;
double server_polls_per_request = 16;
}
// Results of a single benchmark scenario.

@ -47,6 +47,9 @@ message ServerStats {
// change in idle time of the server (data from proc/stat)
uint64 idle_cpu_time = 5;
// Number of polls called inside completion queue
uint64 cq_poll_count = 6;
}
// Histogram params based on grpc/support/histogram.c
@ -81,4 +84,7 @@ message ClientStats {
// Number of failed requests (one row per status code seen)
repeated RequestResultCount request_results = 5;
// Number of polls called inside completion queue
uint64 cq_poll_count = 6;
}

@ -56,7 +56,8 @@ INSTALL_REQUIRES = (
'grpcio>={version}'.format(version=grpc_version.VERSION),
'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION),
'oauth2client>=1.4.7', 'protobuf>=3.3.0', 'six>=1.10',)
'oauth2client>=1.4.7', 'protobuf>=3.3.0', 'six>=1.10', 'google-auth>=1.0.0',
'requests>=2.14.2')
COMMAND_CLASS = {
# Run `preprocess` *before* doing any packaging!

@ -29,10 +29,11 @@
"""The Python implementation of the GRPC interoperability test client."""
import argparse
from oauth2client import client as oauth2client_client
import os
from google import auth as google_auth
from google.auth import jwt as google_auth_jwt
import grpc
from grpc.beta import implementations
from src.proto.grpc.testing import test_pb2
from tests.interop import methods
@ -84,25 +85,24 @@ def _application_default_credentials():
def _stub(args):
target = '{}:{}'.format(args.server_host, args.server_port)
if args.test_case == 'oauth2_auth_token':
google_credentials = _application_default_credentials()
scoped_credentials = google_credentials.create_scoped(
[args.oauth_scope])
access_token = scoped_credentials.get_access_token().access_token
call_credentials = grpc.access_token_call_credentials(access_token)
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
google_credentials.refresh(google_auth.transport.requests.Request())
call_credentials = grpc.access_token_call_credentials(
google_credentials.token)
elif args.test_case == 'compute_engine_creds':
google_credentials = _application_default_credentials()
scoped_credentials = google_credentials.create_scoped(
[args.oauth_scope])
# TODO(https://github.com/grpc/grpc/issues/6799): Eliminate this last
# remaining use of the Beta API.
call_credentials = implementations.google_call_credentials(
scoped_credentials)
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
call_credentials = grpc.metadata_call_credentials(
google_auth.transport.grpc.AuthMetadataPlugin(
credentials=google_credentials,
request=google_auth.transport.requests.Request()))
elif args.test_case == 'jwt_token_creds':
google_credentials = _application_default_credentials()
# TODO(https://github.com/grpc/grpc/issues/6799): Eliminate this last
# remaining use of the Beta API.
call_credentials = implementations.google_call_credentials(
google_credentials)
google_credentials = google_auth_jwt.OnDemandCredentials.from_service_account_file(
os.environ[google_auth.environment_vars.CREDENTIALS])
call_credentials = grpc.metadata_call_credentials(
google_auth.transport.grpc.AuthMetadataPlugin(
credentials=google_credentials, request=None))
else:
call_credentials = None
if args.use_tls:

@ -33,8 +33,10 @@ import json
import os
import threading
from oauth2client import client as oauth2client_client
from google import auth as google_auth
from google.auth import environment_vars as google_auth_environment_vars
from google.auth.transport import grpc as google_auth_transport_grpc
from google.auth.transport import requests as google_auth_transport_requests
import grpc
from grpc.beta import implementations
@ -401,8 +403,7 @@ def _compute_engine_creds(stub, args):
def _oauth2_auth_token(stub, args):
json_key_filename = os.environ[
oauth2client_client.GOOGLE_APPLICATION_CREDENTIALS]
json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
response = _large_unary_common_behavior(stub, True, True, None)
if wanted_email != response.username:
@ -414,8 +415,7 @@ def _oauth2_auth_token(stub, args):
def _jwt_token_creds(stub, args):
json_key_filename = os.environ[
oauth2client_client.GOOGLE_APPLICATION_CREDENTIALS]
json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
response = _large_unary_common_behavior(stub, True, False, None)
if wanted_email != response.username:
@ -424,15 +424,14 @@ def _jwt_token_creds(stub, args):
def _per_rpc_creds(stub, args):
json_key_filename = os.environ[
oauth2client_client.GOOGLE_APPLICATION_CREDENTIALS]
json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
credentials = oauth2client_client.GoogleCredentials.get_application_default()
scoped_credentials = credentials.create_scoped([args.oauth_scope])
# TODO(https://github.com/grpc/grpc/issues/6799): Eliminate this last
# remaining use of the Beta API.
call_credentials = implementations.google_call_credentials(
scoped_credentials)
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
call_credentials = grpc.metadata_call_credentials(
google_auth_transport_grpc.AuthMetadataPlugin(
credentials=google_credentials,
request=google_auth_transport_requests.Request()))
response = _large_unary_common_behavior(stub, True, False, call_credentials)
if wanted_email != response.username:
raise ValueError('expected username %s, got %s' %

@ -38,29 +38,20 @@
set -ex
mkdir -p ..\..\artifacts${"\\"}
mkdir ..\..\artifacts
@rem Collect the artifacts built by the previous build step if running on Jenkins
@rem TODO(jtattermusch): is there a better way to do this?
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* nativelibs\windows_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* nativelibs\windows_x64${"\\"}
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* nativelibs\linux_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* nativelibs\linux_x64${"\\"}
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x64${"\\"}
mkdir nativelibs
powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs"
@rem Collect protoc artifacts built by the previous build step
xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64${"\\"}
xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64${"\\"}
xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64${"\\"}
mkdir protoc_plugins
powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins"
%%DOTNET% restore Grpc.sln || goto :error
@rem To be able to build, we also need to put grpc_csharp_ext to its normal location
xcopy /Y /I nativelibs\windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release${"\\"}
xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release${"\\"}
%%DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error
%%DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error

@ -36,35 +36,19 @@
mkdir -p ../../artifacts/
mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 ${"\\"}
nativelibs/linux_x86 nativelibs/linux_x64 ${"\\"}
nativelibs/macosx_x86 nativelibs/macosx_x64
mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 ${"\\"}
protoc_plugins/linux_x86 protoc_plugins/linux_x64 ${"\\"}
protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
# Collect the artifacts built by the previous build step if running on Jenkins
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
# Collect the artifacts built by the previous build step
mkdir -p nativelibs
cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/csharp_ext_* nativelibs || true
# Collect protoc artifacts built by the previous build step
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
mkdir -p protoc_plugins
cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/protoc_* protoc_plugins || true
dotnet restore Grpc.sln
# To be able to build, we also need to put grpc_csharp_ext to its normal location
mkdir -p ../../libs/opt
cp nativelibs/linux_x64/libgrpc_csharp_ext.so ../../libs/opt
cp nativelibs/csharp_ext_linux_x64/libgrpc_csharp_ext.so ../../libs/opt
dotnet pack --configuration Release Grpc.Core --output ../../../artifacts
dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts

@ -27,6 +27,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load(":generate_tests.bzl", "grpc_bad_client_tests")

@ -212,12 +212,14 @@ static void client_validator(grpc_slice_buffer *incoming) {
}
int main(int argc, char **argv) {
int i;
grpc_test_init(argc, argv);
// Test sending more metadata than the server will accept.
gpr_strvec headers;
gpr_strvec_init(&headers);
for (int i = 0; i < NUM_HEADERS; ++i) {
for (i = 0; i < NUM_HEADERS; ++i) {
char *str;
gpr_asprintf(&str, "%s%02d%s",
PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR, i,

@ -27,6 +27,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load(":generate_tests.bzl", "grpc_bad_ssl_tests")

@ -27,12 +27,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "context_test",
srcs = ["context_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -41,10 +43,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "mlog_test",
srcs = ["mlog_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -53,10 +55,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "resource_test",
srcs = ["resource_test.c"],
copts = ["-std=c99"],
language = "C",
data = [
":data/resource_empty_name.pb",
":data/resource_full.pb",
@ -73,10 +75,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "trace_context_test",
srcs = ["trace_context_test.c"],
copts = ["-std=c99"],
language = "C",
data = [
":data/context_empty.pb",
":data/context_full.pb",

@ -27,12 +27,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "channel_args_test",
srcs = ["channel_args_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -41,10 +43,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "channel_stack_test",
srcs = ["channel_stack_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",

@ -27,21 +27,33 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "uri_fuzzer_test",
srcs = ["uri_fuzzer_test.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "uri_corpus",
copts = ["-std=c99"],
name = "uri_fuzzer_test",
srcs = ["uri_fuzzer_test.c"],
language = "C",
corpus = "uri_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "lb_policies_test",
srcs = ["lb_policies_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:cq_verifier"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:cq_verifier",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,12 +27,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "dns_resolver_connectivity_test",
srcs = ["dns_resolver_connectivity_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -41,10 +43,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "dns_resolver_test",
srcs = ["dns_resolver_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -53,10 +55,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "sockaddr_resolver_test",
srcs = ["sockaddr_resolver_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -65,10 +67,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "fake_resolver_test",
srcs = ["fake_resolver_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",

@ -27,12 +27,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "algorithm_test",
srcs = ["algorithm_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -41,10 +43,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "compression_test",
srcs = ["compression_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -53,10 +55,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "message_compress_test",
srcs = ["message_compress_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",

@ -27,15 +27,17 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load(":generate_tests.bzl", "grpc_end2end_tests")
cc_library(
grpc_cc_library(
name = "cq_verifier",
srcs = ["cq_verifier.c"],
hdrs = ["cq_verifier.h"],
copts = ["-std=c99"],
language = "C",
visibility = ["//test:__subpackages__"],
deps = [
"//:gpr",
@ -44,7 +46,7 @@ cc_library(
],
)
cc_library(
grpc_cc_library(
name = "ssl_test_data",
srcs = [
"data/client_certs.c",
@ -53,15 +55,15 @@ cc_library(
"data/test_root_cert.c",
],
hdrs = ["data/ssl_test_data.h"],
copts = ["-std=c99"],
language = "C",
visibility = ["//test:__subpackages__"],
)
cc_library(
grpc_cc_library(
name = "fake_resolver",
srcs = ["fake_resolver.c"],
hdrs = ["fake_resolver.h"],
copts = ["-std=c99"],
language = "C",
visibility = ["//test:__subpackages__"],
deps = [
"//:gpr",
@ -70,11 +72,11 @@ cc_library(
],
)
cc_library(
grpc_cc_library(
name = "http_proxy",
srcs = ["fixtures/http_proxy_fixture.c"],
hdrs = ["fixtures/http_proxy_fixture.h"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -82,11 +84,11 @@ cc_library(
],
)
cc_library(
grpc_cc_library(
name = "proxy",
srcs = ["fixtures/proxy.c"],
hdrs = ["fixtures/proxy.h"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",

@ -27,30 +27,45 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "api_fuzzer",
srcs = ["api_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util", "//test/core/end2end:ssl_test_data"],
corpus = "api_fuzzer_corpus",
copts = ["-std=c99"],
name = "api_fuzzer",
srcs = ["api_fuzzer.c"],
language = "C",
corpus = "api_fuzzer_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:grpc_test_util",
],
)
grpc_fuzzer(
name = "client_fuzzer",
srcs = ["client_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "client_fuzzer_corpus",
copts = ["-std=c99"],
name = "client_fuzzer",
srcs = ["client_fuzzer.c"],
language = "C",
corpus = "client_fuzzer_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
grpc_fuzzer(
name = "server_fuzzer",
srcs = ["server_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "server_fuzzer_corpus",
copts = ["-std=c99"],
name = "server_fuzzer",
srcs = ["server_fuzzer.c"],
language = "C",
corpus = "server_fuzzer_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)

@ -28,6 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_sh_test", "grpc_cc_binary", "grpc_cc_library")
"""Generates the appropriate build.json data for all the end2end tests."""
@ -56,6 +57,7 @@ END2END_FIXTURES = {
'h2_full': fixture_options(),
'h2_full+pipe': fixture_options(platforms=['linux']),
'h2_full+trace': fixture_options(tracing=True),
'h2_full+workarounds': fixture_options(),
'h2_http_proxy': fixture_options(),
'h2_oauth2': fixture_options(),
'h2_proxy': fixture_options(includes_proxy=True),
@ -135,6 +137,7 @@ END2END_TESTS = {
'trailing_metadata': test_options(),
'authority_not_supported': test_options(),
'filter_latency': test_options(),
'workaround_cronet_compression': test_options(),
'write_buffering': test_options(),
'write_buffering_at_end': test_options(),
}
@ -157,7 +160,7 @@ def compatible(fopt, topt):
def grpc_end2end_tests():
native.cc_library(
grpc_cc_library(
name = 'end2end_tests',
srcs = ['end2end_tests.c', 'end2end_test_utils.c'] + [
'tests/%s.c' % t
@ -166,31 +169,33 @@ def grpc_end2end_tests():
'tests/cancel_test_helpers.h',
'end2end_tests.h'
],
copts = ['-std=c99'],
language = "C",
deps = [
':cq_verifier',
':ssl_test_data',
':fake_resolver',
':http_proxy',
':proxy',
'//test/core/util:grpc_test_util',
'//:grpc',
'//test/core/util:gpr_test_util',
'//:gpr',
]
)
for f, fopt in END2END_FIXTURES.items():
native.cc_binary(
grpc_cc_binary(
name = '%s_test' % f,
srcs = ['fixtures/%s.c' % f],
copts = ['-std=c99'],
deps = [':end2end_tests']
language = "C",
deps = [
':end2end_tests',
'//test/core/util:grpc_test_util',
'//:grpc',
'//test/core/util:gpr_test_util',
'//:gpr',
],
)
for t, topt in END2END_TESTS.items():
#print(compatible(fopt, topt), f, t, fopt, topt)
if not compatible(fopt, topt): continue
native.sh_test(
grpc_sh_test(
name = '%s_test@%s' % (f, t),
srcs = ['end2end_test.sh'],
args = ['$(location %s_test)' % f, t],

@ -27,36 +27,68 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
cc_binary(
grpc_cc_binary(
name = "client",
srcs = ["client.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
testonly = 1,
copts = ['-std=c99']
srcs = ["client.c"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_binary(
grpc_cc_binary(
name = "server",
srcs = ["server.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
testonly = 1,
copts = ['-std=c99']
srcs = ["server.c"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "fling",
srcs = ["fling_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
data = [":client", ":server"]
data = [
":client",
":server",
],
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "fling_stream",
srcs = ["fling_stream_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
data = [":client", ":server"]
data = [
":client",
":server",
],
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,12 +27,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "client_ssl",
srcs = ["client_ssl.c"],
copts = ["-std=c99"],
language = "C",
data = [
"//src/core/tsi/test_creds:ca.pem",
"//src/core/tsi/test_creds:server1.key",
@ -46,10 +48,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "server_ssl",
srcs = ["server_ssl.c"],
copts = ["-std=c99"],
language = "C",
data = [
"//src/core/tsi/test_creds:ca.pem",
"//src/core/tsi/test_creds:server1.key",

@ -27,24 +27,34 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "response_fuzzer",
srcs = ["response_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "response_corpus",
copts = ["-std=c99"],
name = "response_fuzzer",
srcs = ["response_fuzzer.c"],
language = "C",
corpus = "response_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
grpc_fuzzer(
name = "request_fuzzer",
srcs = ["request_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "request_corpus",
copts = ["-std=c99"],
name = "request_fuzzer",
srcs = ["request_fuzzer.c"],
language = "C",
corpus = "request_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
# Copyright 2017, Google Inc.
@ -80,25 +90,43 @@ licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
cc_test(
grpc_cc_test(
name = "httpcli_test",
srcs = ["httpcli_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
copts = ['-std=c99'],
data = ['test_server.py']
language = "C",
data = ["test_server.py"],
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "httpscli_test",
srcs = ["httpscli_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
copts = ['-std=c99'],
data = ['test_server.py']
language = "C",
data = ["test_server.py"],
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "parser_test",
srcs = ["parser_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/end2end:ssl_test_data"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,155 +27,266 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
cc_library(
package(default_visibility = ["//visibility:public"]) # Useful for third party devs to test their io manager implementation.
grpc_cc_library(
name = "endpoint_tests",
srcs = ["endpoint_tests.c"],
hdrs = ["endpoint_tests.h"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
language = "C",
visibility = ["//test:__subpackages__"],
copts = ['-std=c99']
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "combiner_test",
srcs = ["combiner_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "endpoint_pair_test",
srcs = ["endpoint_pair_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", ":endpoint_tests"],
copts = ['-std=c99']
language = "C",
deps = [
":endpoint_tests",
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "ev_epollsig_linux_test",
srcs = ["ev_epollsig_linux_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
language = "C",
)
cc_test(
grpc_cc_test(
name = "fd_conservation_posix_test",
srcs = ["fd_conservation_posix_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "fd_posix_test",
srcs = ["fd_posix_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "load_file_test",
srcs = ["load_file_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "pollset_set_test",
srcs = ["pollset_set_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "resolve_address_posix_test",
srcs = ["resolve_address_posix_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "resolve_address_test",
srcs = ["resolve_address_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "resource_quota_test",
srcs = ["resource_quota_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "sockaddr_utils_test",
srcs = ["sockaddr_utils_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "socket_utils_test",
srcs = ["socket_utils_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "tcp_client_posix_test",
srcs = ["tcp_client_posix_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "tcp_posix_test",
srcs = ["tcp_posix_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", ":endpoint_tests"],
copts = ['-std=c99']
language = "C",
deps = [
":endpoint_tests",
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "tcp_server_posix_test",
srcs = ["tcp_server_posix_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "time_averaged_stats_test",
srcs = ["time_averaged_stats_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "timer_heap_test",
srcs = ["timer_heap_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "timer_list_test",
srcs = ["timer_list_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "udp_server_test",
srcs = ["udp_server_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "wakeup_fd_cv_test",
srcs = ["wakeup_fd_cv_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,44 +27,75 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "json_fuzzer",
srcs = ["fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "corpus",
copts = ["-std=c99"],
name = "json_fuzzer",
srcs = ["fuzzer.c"],
language = "C",
corpus = "corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
cc_binary(
grpc_cc_binary(
name = "json_rewrite",
srcs = ["json_rewrite.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
testonly = 1,
copts = ['-std=c99']
srcs = ["json_rewrite.c"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "json_rewrite_test",
srcs = ["json_rewrite_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99'],
data = ["rewrite_test_input.json", "rewrite_test_output_condensed.json", "rewrite_test_output_indented.json", ":json_stream_error_test"]
language = "C",
data = [
"rewrite_test_input.json",
"rewrite_test_output_condensed.json",
"rewrite_test_output_indented.json",
":json_stream_error_test",
],
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "json_stream_error_test",
srcs = ["json_stream_error_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "json_test",
srcs = ["json_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,23 +27,32 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "fuzzer_response",
srcs = ["fuzzer_response.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "corpus_response",
copts = ["-std=c99"],
name = "fuzzer_response",
srcs = ["fuzzer_response.c"],
language = "C",
corpus = "corpus_response",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
grpc_fuzzer(
name = "fuzzer_serverlist",
srcs = ["fuzzer_serverlist.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "corpus_serverlist",
copts = ["-std=c99"],
name = "fuzzer_serverlist",
srcs = ["fuzzer_serverlist.c"],
language = "C",
corpus = "corpus_serverlist",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)

@ -27,11 +27,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_binary(
grpc_cc_binary(
name = "low_level_ping_pong",
srcs = ["low_level_ping_pong.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,72 +27,110 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "ssl_server_fuzzer",
srcs = ["ssl_server_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util", "//test/core/end2end:ssl_test_data"],
corpus = "corpus",
copts = ["-std=c99"],
name = "ssl_server_fuzzer",
srcs = ["ssl_server_fuzzer.c"],
language = "C",
corpus = "corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/end2end:ssl_test_data",
"//test/core/util:grpc_test_util",
],
)
cc_library(
grpc_cc_library(
name = "oauth2_utils",
srcs = ["oauth2_utils.c"],
hdrs = ["oauth2_utils.h"],
language = "C",
deps = ["//:grpc"],
copts = ['-std=c99'],
visibility = ["//test/cpp:__subpackages__"],
)
cc_test(
grpc_cc_test(
name = "auth_context_test",
srcs = ["auth_context_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "credentials_test",
srcs = ["credentials_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "secure_endpoint_test",
srcs = ["secure_endpoint_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util", "//test/core/iomgr:endpoint_tests"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/iomgr:endpoint_tests",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "security_connector_test",
srcs = ["security_connector_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_binary(
grpc_cc_binary(
name = "create_jwt",
srcs = ["create_jwt.c"],
deps = ["//:grpc", "//:gpr"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
],
)
cc_binary(
grpc_cc_binary(
name = "fetch_oauth2",
srcs = ["fetch_oauth2.c"],
deps = ["//:grpc", "//:gpr", ":oauth2_utils"],
copts = ['-std=c99']
language = "C",
deps = [
":oauth2_utils",
"//:gpr",
"//:grpc",
],
)
cc_binary(
grpc_cc_binary(
name = "verify_jwt",
srcs = ["verify_jwt.c"],
deps = ["//:grpc", "//:gpr"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
],
)

@ -27,56 +27,77 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "percent_decode_fuzzer",
srcs = ["percent_decode_fuzzer.c"],
deps = ["//:gpr", "//:grpc", "//test/core/util:grpc_test_util"],
corpus = "response_corpus",
copts = ["-std=c99"],
name = "percent_decode_fuzzer",
srcs = ["percent_decode_fuzzer.c"],
language = "C",
corpus = "response_corpus",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "percent_encoding_test",
srcs = ["percent_encoding_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "slice_test",
srcs = ["slice_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
)
cc_test(
grpc_cc_test(
name = "slice_string_helpers_test",
srcs = ["slice_string_helpers_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "slice_buffer_test",
srcs = ["slice_buffer_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
)
cc_test(
grpc_cc_test(
name = "slice_hash_table_test",
srcs = ["slice_hash_table_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
)
cc_test(
grpc_cc_test(
name = "b64_test",
srcs = ["b64_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,137 +27,196 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "alloc_test",
srcs = ["alloc_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "avl_test",
srcs = ["avl_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "backoff_test",
srcs = ["backoff_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "cmdline_test",
srcs = ["cmdline_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "cpu_test",
srcs = ["cpu_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "env_test",
srcs = ["env_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "histogram_test",
srcs = ["histogram_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "host_port_test",
srcs = ["host_port_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "log_test",
srcs = ["log_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "mpscq_test",
srcs = ["mpscq_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "murmur_hash_test",
srcs = ["murmur_hash_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "stack_lockfree_test",
srcs = ["stack_lockfree_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "string_test",
srcs = ["string_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "spinlock_test",
srcs = ["spinlock_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "sync_test",
srcs = ["sync_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "thd_test",
srcs = ["thd_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "time_test",
srcs = ["time_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "tls_test",
srcs = ["tls_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)
cc_test(
grpc_cc_test(
name = "useful_test",
srcs = ["useful_test.c"],
deps = ["//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//test/core/util:gpr_test_util",
],
)

@ -27,12 +27,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "alarm_test",
srcs = ["alarm_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -41,10 +43,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "grpc_byte_buffer_reader_test",
srcs = ["byte_buffer_reader_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -53,10 +55,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "channel_create_test",
srcs = ["channel_create_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -65,10 +67,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "grpc_completion_queue_test",
srcs = ["completion_queue_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -77,10 +79,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "concurrent_connectivity_test",
srcs = ["concurrent_connectivity_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -89,10 +91,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "init_test",
srcs = ["init_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -101,10 +103,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "grpc_invalid_channel_args_test",
srcs = ["invalid_channel_args_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -113,10 +115,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "lame_client_test",
srcs = ["lame_client_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -126,10 +128,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "public_headers_must_be_c89",
srcs = ["public_headers_must_be_c89.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -138,10 +140,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "secure_channel_create_test",
srcs = ["secure_channel_create_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -150,10 +152,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "sequential_connectivity_test",
srcs = ["sequential_connectivity_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -163,10 +165,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "server_chttp2_test",
srcs = ["server_chttp2_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",
@ -175,10 +177,10 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "server_test",
srcs = ["server_test.c"],
copts = ["-std=c99"],
language = "C",
deps = [
"//:gpr",
"//:grpc",

@ -27,53 +27,90 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "bdp_estimator_test",
srcs = ["bdp_estimator_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "connectivity_state_test",
srcs = ["connectivity_state_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "metadata_test",
srcs = ["metadata_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "pid_controller_test",
srcs = ["pid_controller_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "status_conversion_test",
srcs = ["status_conversion_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "stream_owned_slice_test",
srcs = ["stream_owned_slice_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "timeout_encoding_test",
srcs = ["timeout_encoding_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,69 +27,114 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
grpc_fuzzer(
name = "hpack_parser_fuzzer",
srcs = ["hpack_parser_fuzzer_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util"],
corpus = "hpack_parser_corpus"
name = "hpack_parser_fuzzer",
srcs = ["hpack_parser_fuzzer_test.c"],
corpus = "hpack_parser_corpus",
deps = [
"//:grpc",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "alpn_test",
srcs = ["alpn_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "bin_decoder_test",
srcs = ["bin_decoder_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "bin_encoder_test",
srcs = ["bin_encoder_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "hpack_encoder_test",
srcs = ["hpack_encoder_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "hpack_parser_test",
srcs = ["hpack_parser_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "hpack_table_test",
srcs = ["hpack_table_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "stream_map_test",
srcs = ["stream_map_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)
cc_test(
grpc_cc_test(
name = "varint_test",
srcs = ["varint_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,11 +27,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_test(
grpc_cc_test(
name = "transport_security_test",
srcs = ["transport_security_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
language = "C",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -27,23 +27,26 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
licenses(["notice"]) # 3-clause BSD
cc_library(
package(default_visibility = ["//visibility:public"])
grpc_cc_library(
name = "gpr_test_util",
srcs = [
"test_config.c",
"memory_counters.c",
"test_config.c",
],
hdrs = [
"test_config.h",
"memory_counters.h",
"test_config.h",
],
deps = ["//:gpr"],
visibility = ["//:__subpackages__"],
)
cc_library(
grpc_cc_library(
name = "grpc_test_util",
srcs = [
"debugger_macros.c",
@ -60,7 +63,6 @@ cc_library(
],
hdrs = [
"debugger_macros.h",
"trickle_endpoint.h",
"grpc_profiler.h",
"mock_endpoint.h",
"parse_hexstring.h",
@ -70,21 +72,25 @@ cc_library(
"reconnect_server.h",
"slice_splitter.h",
"test_tcp_server.h",
"trickle_endpoint.h",
],
language = "C",
deps = [
":gpr_test_util",
"//:grpc",
],
deps = [":gpr_test_util", "//:grpc"],
visibility = ["//test:__subpackages__"],
copts = ["-std=c99"],
)
cc_library(
name = "one_corpus_entry_fuzzer",
srcs = ["one_corpus_entry_fuzzer.c"],
deps = [":gpr_test_util", "//:grpc"],
visibility = ["//test:__subpackages__"],
grpc_cc_library(
name = "one_corpus_entry_fuzzer",
srcs = ["one_corpus_entry_fuzzer.c"],
deps = [
":gpr_test_util",
"//:grpc",
],
)
sh_library(
name = "fuzzer_one_entry_runner",
srcs = ["fuzzer_one_entry_runner.sh"],
visibility = ["//test:__subpackages__"],
name = "fuzzer_one_entry_runner",
srcs = ["fuzzer_one_entry_runner.sh"],
)

@ -27,8 +27,10 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
load("//bazel:grpc_build_system.bzl", "grpc_cc_binary")
def grpc_fuzzer(name, corpus, srcs = [], deps = [], **kwargs):
native.cc_binary(
grpc_cc_binary(
name = '%s/one_entry.bin' % name,
srcs = srcs,
deps = deps + ["//test/core/util:one_corpus_entry_fuzzer"],

@ -29,37 +29,45 @@
licenses(["notice"]) # 3-clause BSD
cc_test(
load("//bazel:grpc_build_system.bzl", "grpc_cc_test")
grpc_cc_test(
name = "codegen_test_full",
srcs = ["codegen_test_full.cc"],
deps = [
"//:grpc++",
"//external:gtest",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "codegen_test_minimal",
srcs = ["codegen_test_minimal.cc"],
deps = [
"//:grpc++",
"//external:gtest",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "proto_utils_test",
srcs = ["proto_utils_test.cc"],
deps = [
"//:grpc++",
"//external:gtest",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "golden_file_test",
srcs = ["golden_file_test.cc"],
args = ["--generated_file_path=$(GENDIR)/src/proto/grpc/testing/"],
@ -69,9 +77,11 @@ cc_test(
],
deps = [
"//:grpc++",
"//external:gflags",
"//external:gtest",
"//src/proto/grpc/testing:compiler_test_proto",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
"gflags",
],
)

@ -29,32 +29,66 @@
licenses(["notice"]) # 3-clause BSD
cc_test(
load("//bazel:grpc_build_system.bzl", "grpc_cc_test")
grpc_cc_test(
name = "alarm_cpp_test",
srcs = ["alarm_cpp_test.cc"],
deps = ["//:grpc++", "//external:gtest", "//test/core/util:gpr_test_util"],
deps = [
"//:grpc++",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "auth_property_iterator_test",
srcs = ["auth_property_iterator_test.cc"],
deps = ["//:grpc++", "//external:gtest", "//test/core/util:gpr_test_util", "//test/cpp/util:test_util"],
deps = [
"//:grpc++",
"//test/core/util:gpr_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "channel_arguments_test",
srcs = ["channel_arguments_test.cc"],
deps = ["//:grpc++", "//external:gtest", "//test/core/util:gpr_test_util"],
deps = [
"//:grpc++",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "channel_filter_test",
srcs = ["channel_filter_test.cc"],
deps = ["//:grpc++", "//external:gtest", "//test/core/util:gpr_test_util"],
deps = [
"//:grpc++",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "secure_auth_context_test",
srcs = ["secure_auth_context_test.cc"],
deps = ["//:grpc++", "//external:gtest", "//test/core/util:gpr_test_util", "//test/cpp/util:test_util"],
deps = [
"//:grpc++",
"//test/core/util:gpr_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)

@ -29,25 +29,30 @@
licenses(["notice"]) # 3-clause BSD
cc_library(
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test")
package(default_visibility=["//visibility:public"]) # Allows external users to implement end2end tests.
grpc_cc_library(
name = "test_service_impl",
srcs = ["test_service_impl.cc"],
hdrs = ["test_service_impl.h"],
deps = [
"//external:gtest",
"//src/proto/grpc/testing:echo_proto",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "async_end2end_test",
srcs = ["async_end2end_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/health/v1:health_proto",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
@ -56,16 +61,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "client_crash_test",
srcs = ["client_crash_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -73,17 +80,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "client_crash_test_server",
srcs = ["client_crash_test_server.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gflags",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -91,17 +99,21 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gflags",
"gtest",
],
)
cc_test(
name = "end2end_test",
grpc_cc_library(
name = "end2end_test_lib",
srcs = ["end2end_test.cc"],
testonly = True,
deps = [
":test_service_impl",
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -109,16 +121,25 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "end2end_test",
deps = [
":end2end_test_lib"
],
)
grpc_cc_test(
name = "filter_end2end_test",
srcs = ["filter_end2end_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -126,16 +147,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "generic_end2end_test",
srcs = ["generic_end2end_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -143,9 +166,12 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "hybrid_end2end_test",
srcs = ["hybrid_end2end_test.cc"],
deps = [
@ -153,7 +179,6 @@ cc_test(
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -161,16 +186,19 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "mock_test",
srcs = ["mock_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//:grpc++_test",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -178,9 +206,12 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "round_robin_end2end_test",
srcs = ["round_robin_end2end_test.cc"],
deps = [
@ -188,7 +219,6 @@ cc_test(
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -196,10 +226,12 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "grpclb_end2end_test",
srcs = ["grpclb_end2end_test.cc"],
deps = [
@ -207,7 +239,6 @@ cc_test(
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/lb/v1:load_balancer_proto",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
@ -217,9 +248,12 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "proto_server_reflection_test",
srcs = ["proto_server_reflection_test.cc"],
deps = [
@ -228,8 +262,6 @@ cc_test(
"//:grpc",
"//:grpc++",
"//:grpc++_reflection",
"//external:gflags",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -238,9 +270,13 @@ cc_test(
"//test/cpp/util:grpc++_proto_reflection_desc_db",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
"gflags",
],
)
cc_test(
grpc_cc_test(
name = "server_builder_plugin_test",
srcs = ["server_builder_plugin_test.cc"],
deps = [
@ -248,7 +284,6 @@ cc_test(
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -256,16 +291,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "server_crash_test",
srcs = ["server_crash_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -273,17 +310,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "server_crash_test_client",
srcs = ["server_crash_test_client.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gflags",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -291,16 +329,19 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gflags",
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "shutdown_test",
srcs = ["shutdown_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -308,16 +349,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "streaming_throughput_test",
srcs = ["streaming_throughput_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -325,16 +368,18 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_test(
grpc_cc_test(
name = "thread_stress_test",
srcs = ["thread_stress_test.cc"],
deps = [
"//:gpr",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
"//src/proto/grpc/testing:echo_proto",
"//src/proto/grpc/testing/duplicate:echo_duplicate_proto",
@ -342,4 +387,7 @@ cc_test(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)

@ -47,7 +47,6 @@
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/tls.h>
#include <gtest/gtest.h>
#include "src/core/lib/iomgr/port.h"
#include "src/proto/grpc/health/v1/health.grpc.pb.h"
@ -58,6 +57,8 @@
#include "test/cpp/util/string_ref_helper.h"
#include "test/cpp/util/test_credentials_provider.h"
#include <gtest/gtest.h>
#ifdef GRPC_POSIX_SOCKET
#include "src/core/lib/iomgr/ev_posix.h"
#endif

@ -41,7 +41,6 @@
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@ -49,6 +48,8 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/subprocess.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -48,7 +48,6 @@
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/core/lib/security/credentials/credentials.h"
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
@ -59,6 +58,8 @@
#include "test/cpp/util/string_ref_helper.h"
#include "test/cpp/util/test_credentials_provider.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using grpc::testing::kTlsCredentialsType;

@ -48,7 +48,6 @@
#include <grpc/grpc.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/cpp/common/channel_filter.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@ -56,6 +55,8 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -46,13 +46,14 @@
#include <grpc/grpc.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -46,7 +46,6 @@
#include <grpc++/server_context.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/health/v1/health.grpc.pb.h"
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
@ -55,6 +54,8 @@
#include "test/core/util/test_config.h"
#include "test/cpp/end2end/test_service_impl.h"
#include <gtest/gtest.h>
using grpc::health::v1::Health;
using grpc::health::v1::HealthCheckRequest;
using grpc::health::v1::HealthCheckResponse;

@ -42,7 +42,6 @@
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc/grpc.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@ -51,6 +50,8 @@
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
#include <gtest/gtest.h>
namespace grpc {
namespace testing {

@ -45,7 +45,6 @@
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include <grpc++/test/mock_stream.h>
@ -55,6 +54,8 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include <gtest/gtest.h>
#include <iostream>
using namespace std;

@ -41,7 +41,6 @@
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc/grpc.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
@ -49,6 +48,8 @@
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/proto_reflection_descriptor_database.h"
#include <gtest/gtest.h>
namespace grpc {
namespace testing {

@ -44,13 +44,14 @@
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/end2end/test_service_impl.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -45,13 +45,14 @@
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc/grpc.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/end2end/test_service_impl.h"
#include <gtest/gtest.h>
#define PLUGIN_NAME "TestServerBuilderPlugin"
namespace grpc {

@ -41,7 +41,6 @@
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@ -49,6 +48,8 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/subprocess.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -33,8 +33,6 @@
#include <thread>
#include <gtest/gtest.h>
#include <grpc++/channel.h>
#include <grpc++/client_context.h>
#include <grpc++/create_channel.h>
@ -51,6 +49,8 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;

@ -35,8 +35,6 @@
#include <mutex>
#include <thread>
#include <gtest/gtest.h>
#include <grpc++/channel.h>
#include <grpc++/client_context.h>
#include <grpc++/create_channel.h>
@ -56,6 +54,8 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -40,11 +40,11 @@
#include <grpc++/server_context.h>
#include <grpc/support/log.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/util/string_ref_helper.h"
#include <gtest/gtest.h>
using std::chrono::system_clock;
namespace grpc {

@ -43,7 +43,6 @@
#include <grpc/grpc.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/core/lib/surface/api_trace.h"
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
@ -51,6 +50,8 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include <gtest/gtest.h>
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
using std::chrono::system_clock;

@ -29,14 +29,17 @@
licenses(["notice"]) # 3-clause BSD
cc_test(
load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library")
grpc_cc_test(
name = "noop-benchmark",
srcs = ["noop-benchmark.cc"],
linkopts = ["-pthread"],
deps = ["//external:benchmark"],
external_deps = [
"benchmark",
],
)
cc_library(
grpc_cc_library(
name = "helpers",
srcs = ["helpers.cc"],
hdrs = [
@ -44,64 +47,68 @@ cc_library(
"fullstack_fixtures.h",
"helpers.h",
],
linkopts = ["-pthread"],
deps = [
"//:grpc++",
"//external:benchmark",
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util",
],
external_deps = [
"benchmark",
],
)
cc_test(
grpc_cc_test(
name = "bm_closure",
srcs = ["bm_closure.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_cq",
srcs = ["bm_cq.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_cq_multiple_threads",
srcs = ["bm_cq_multiple_threads.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_error",
srcs = ["bm_error.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_fullstack_streaming_ping_pong",
srcs = ["bm_fullstack_streaming_ping_pong.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_fullstack_streaming_pump",
srcs = ["bm_fullstack_streaming_pump.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_fullstack_trickle",
srcs = ["bm_fullstack_trickle.cc"],
deps = [":helpers", "//external:gflags"],
deps = [":helpers"],
external_deps = [
"gflags",
],
)
cc_test(
grpc_cc_test(
name = "bm_fullstack_unary_ping_pong",
srcs = ["bm_fullstack_unary_ping_pong.cc"],
deps = [":helpers"],
)
cc_test(
grpc_cc_test(
name = "bm_metadata",
srcs = ["bm_metadata.cc"],
deps = [":helpers"],

@ -81,10 +81,16 @@ static void cq_done_cb(grpc_exec_ctx* exec_ctx, void* done_arg,
gpr_free(cq_completion);
}
/* Queues a completion tag. ZERO polling overhead */
/* Queues a completion tag if deadline is > 0.
* Does nothing if deadline is 0 (i.e gpr_time_0(GPR_CLOCK_MONOTONIC)) */
static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* ps,
grpc_pollset_worker** worker, gpr_timespec now,
gpr_timespec deadline) {
if (gpr_time_cmp(deadline, gpr_time_0(GPR_CLOCK_MONOTONIC)) == 0) {
gpr_log(GPR_ERROR, "no-op");
return GRPC_ERROR_NONE;
}
gpr_mu_unlock(&ps->mu);
grpc_cq_begin_op(g_cq, g_tag);
grpc_cq_end_op(exec_ctx, g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, NULL,
@ -115,6 +121,14 @@ static void setup() {
static void teardown() {
grpc_completion_queue_shutdown(g_cq);
/* Drain any events */
gpr_timespec deadline = gpr_time_0(GPR_CLOCK_MONOTONIC);
while (grpc_completion_queue_next(g_cq, deadline, NULL).type !=
GRPC_QUEUE_SHUTDOWN) {
/* Do nothing */
}
grpc_completion_queue_destroy(g_cq);
}

@ -100,6 +100,12 @@ class FullstackFixture : public BaseFixture {
}
}
void AddToLabel(std::ostream& out, benchmark::State& state) {
BaseFixture::AddToLabel(out, state);
out << " polls/iter:"
<< (double)grpc_get_cq_poll_num(this->cq()->cq()) / state.iterations();
}
ServerCompletionQueue* cq() { return cq_.get(); }
std::shared_ptr<Channel> channel() { return channel_; }
@ -212,6 +218,12 @@ class EndpointPairFixture : public BaseFixture {
}
}
void AddToLabel(std::ostream& out, benchmark::State& state) {
BaseFixture::AddToLabel(out, state);
out << " polls/iter:"
<< (double)grpc_get_cq_poll_num(this->cq()->cq()) / state.iterations();
}
ServerCompletionQueue* cq() { return cq_.get(); }
std::shared_ptr<Channel> channel() { return channel_; }
@ -245,7 +257,7 @@ class InProcessCHTTP2 : public EndpointPairFixture {
void AddToLabel(std::ostream& out, benchmark::State& state) {
EndpointPairFixture::AddToLabel(out, state);
out << " writes/iter:"
<< ((double)stats_.num_writes / (double)state.iterations());
<< (double)stats_.num_writes / (double)state.iterations();
}
private:

@ -29,14 +29,17 @@
licenses(["notice"]) # 3-clause BSD
cc_library(
load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary")
grpc_cc_library(
name = "parse_json",
srcs = ["parse_json.cc"],
hdrs = ["parse_json.h"],
deps = ["//:grpc++"],
external_deps = ["protobuf"],
)
cc_library(
grpc_cc_library(
name = "qps_worker_impl",
srcs = [
"client_async.cc",
@ -56,7 +59,6 @@ cc_library(
":usage_timer",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:control_proto",
"//src/proto/grpc/testing:payloads_proto",
"//src/proto/grpc/testing:services_proto",
@ -65,9 +67,12 @@ cc_library(
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
external_deps = [
"gtest",
],
)
cc_library(
grpc_cc_library(
name = "driver_impl",
srcs = [
"driver.cc",
@ -90,7 +95,7 @@ cc_library(
],
)
cc_library(
grpc_cc_library(
name = "benchmark_config",
srcs = [
"benchmark_config.cc",
@ -102,12 +107,14 @@ cc_library(
":driver_impl",
":histogram",
"//:grpc++",
"//external:gflags",
"//src/proto/grpc/testing:control_proto",
],
external_deps = [
"gflags",
],
)
cc_library(
grpc_cc_library(
name = "histogram",
hdrs = [
"histogram.h",
@ -116,13 +123,13 @@ cc_library(
deps = ["//:gpr"],
)
cc_library(
grpc_cc_library(
name = "interarrival",
hdrs = ["interarrival.h"],
deps = ["//:grpc++"],
)
cc_binary(
grpc_cc_binary(
name = "json_run_localhost",
srcs = ["json_run_localhost.cc"],
deps = [
@ -133,7 +140,7 @@ cc_binary(
],
)
cc_test(
grpc_cc_test(
name = "qps_interarrival_test",
srcs = ["qps_interarrival_test.cc"],
deps = [
@ -142,18 +149,20 @@ cc_test(
],
)
cc_binary(
grpc_cc_binary(
name = "qps_json_driver",
srcs = ["qps_json_driver.cc"],
deps = [
":benchmark_config",
":driver_impl",
"//:grpc++",
"//external:gflags",
],
external_deps = [
"gflags",
],
)
cc_test(
grpc_cc_test(
name = "qps_openloop_test",
srcs = ["qps_openloop_test.cc"],
deps = [
@ -163,7 +172,7 @@ cc_test(
],
)
cc_test(
grpc_cc_test(
name = "secure_sync_unary_ping_pong_test",
srcs = ["secure_sync_unary_ping_pong_test.cc"],
deps = [
@ -173,14 +182,14 @@ cc_test(
],
)
cc_library(
grpc_cc_library(
name = "usage_timer",
srcs = ["usage_timer.cc"],
hdrs = ["usage_timer.h"],
deps = ["//:gpr"],
)
cc_binary(
grpc_cc_binary(
name = "qps_worker",
srcs = ["worker.cc"],
deps = [

@ -46,6 +46,7 @@
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/surface/completion_queue.h"
#include "src/proto/grpc/testing/payloads.pb.h"
#include "src/proto/grpc/testing/services.grpc.pb.h"
@ -150,7 +151,8 @@ class Client {
Client()
: timer_(new UsageTimer),
interarrival_timer_(),
started_requests_(false) {
started_requests_(false),
last_reset_poll_count_(0) {
gpr_event_init(&start_requests_);
}
virtual ~Client() {}
@ -162,6 +164,8 @@ class Client {
MaybeStartRequests();
int cur_poll_count = GetPollCount();
int poll_count = cur_poll_count - last_reset_poll_count_;
if (reset) {
std::vector<Histogram> to_merge(threads_.size());
std::vector<StatusHistogram> to_merge_status(threads_.size());
@ -176,6 +180,7 @@ class Client {
MergeStatusHistogram(to_merge_status[i], &statuses);
}
timer_result = timer->Mark();
last_reset_poll_count_ = cur_poll_count;
} else {
// merge snapshots of each thread histogram
for (size_t i = 0; i < threads_.size(); i++) {
@ -195,6 +200,7 @@ class Client {
stats.set_time_elapsed(timer_result.wall);
stats.set_time_system(timer_result.system);
stats.set_time_user(timer_result.user);
stats.set_cq_poll_count(poll_count);
return stats;
}
@ -209,6 +215,11 @@ class Client {
}
}
virtual int GetPollCount() {
// For sync client.
return 0;
}
protected:
bool closed_loop_;
gpr_atm thread_pool_done_;
@ -351,6 +362,8 @@ class Client {
gpr_event start_requests_;
bool started_requests_;
int last_reset_poll_count_;
void MaybeStartRequests() {
if (!started_requests_) {
started_requests_ = true;

@ -205,6 +205,14 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
}
}
int GetPollCount() override {
int count = 0;
for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) {
count += grpc_get_cq_poll_num((*cq)->cq());
}
return count;
}
protected:
const int num_async_threads_;

@ -48,7 +48,6 @@
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <gtest/gtest.h>
#include "src/core/lib/profiling/timers.h"
#include "src/proto/grpc/testing/services.grpc.pb.h"

@ -112,6 +112,8 @@ static deque<string> get_workers(const string& env_name) {
static double WallTime(ClientStats s) { return s.time_elapsed(); }
static double SystemTime(ClientStats s) { return s.time_system(); }
static double UserTime(ClientStats s) { return s.time_user(); }
static double CliPollCount(ClientStats s) { return s.cq_poll_count(); }
static double SvrPollCount(ServerStats s) { return s.cq_poll_count(); }
static double ServerWallTime(ServerStats s) { return s.time_elapsed(); }
static double ServerSystemTime(ServerStats s) { return s.time_system(); }
static double ServerUserTime(ServerStats s) { return s.time_user(); }
@ -180,6 +182,11 @@ static void postprocess_scenario_result(ScenarioResult* result) {
result->mutable_summary()->set_failed_requests_per_second(failures /
time_estimate);
}
result->mutable_summary()->set_client_polls_per_request(
sum(result->client_stats(), CliPollCount) / histogram.Count());
result->mutable_summary()->set_server_polls_per_request(
sum(result->server_stats(), SvrPollCount) / histogram.Count());
}
std::unique_ptr<ScenarioResult> RunScenario(

@ -94,6 +94,7 @@ static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario,
GetReporter()->ReportLatency(*result);
GetReporter()->ReportTimes(*result);
GetReporter()->ReportCpuUsage(*result);
GetReporter()->ReportPollCount(*result);
for (int i = 0; *success && i < result->client_success_size(); i++) {
*success = result->client_success(i);

@ -80,6 +80,12 @@ void CompositeReporter::ReportCpuUsage(const ScenarioResult& result) {
}
}
void CompositeReporter::ReportPollCount(const ScenarioResult& result) {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportPollCount(result);
}
}
void GprLogReporter::ReportQPS(const ScenarioResult& result) {
gpr_log(GPR_INFO, "QPS: %.1f", result.summary().qps());
if (result.summary().failed_requests_per_second() > 0) {
@ -121,6 +127,13 @@ void GprLogReporter::ReportCpuUsage(const ScenarioResult& result) {
result.summary().server_cpu_usage());
}
void GprLogReporter::ReportPollCount(const ScenarioResult& result) {
gpr_log(GPR_INFO, "Client Polls per Request: %.2f",
result.summary().client_polls_per_request());
gpr_log(GPR_INFO, "Server Polls per Request: %.2f",
result.summary().server_polls_per_request());
}
void JsonReporter::ReportQPS(const ScenarioResult& result) {
grpc::string json_string =
SerializeJson(result, "type.googleapis.com/grpc.testing.ScenarioResult");
@ -145,6 +158,10 @@ void JsonReporter::ReportCpuUsage(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS.
}
void JsonReporter::ReportPollCount(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS.
}
void RpcReporter::ReportQPS(const ScenarioResult& result) {
grpc::ClientContext context;
grpc::Status status;
@ -177,5 +194,9 @@ void RpcReporter::ReportCpuUsage(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS.
}
void RpcReporter::ReportPollCount(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS.
}
} // namespace testing
} // namespace grpc

@ -76,6 +76,9 @@ class Reporter {
/** Reports server cpu usage. */
virtual void ReportCpuUsage(const ScenarioResult& result) = 0;
/** Reports client and server poll usage inside completion queue. */
virtual void ReportPollCount(const ScenarioResult& result) = 0;
private:
const string name_;
};
@ -93,6 +96,7 @@ class CompositeReporter : public Reporter {
void ReportLatency(const ScenarioResult& result) override;
void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override;
private:
std::vector<std::unique_ptr<Reporter> > reporters_;
@ -109,6 +113,7 @@ class GprLogReporter : public Reporter {
void ReportLatency(const ScenarioResult& result) override;
void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override;
};
/** Dumps the report to a JSON file. */
@ -123,6 +128,7 @@ class JsonReporter : public Reporter {
void ReportLatency(const ScenarioResult& result) override;
void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override;
const string report_file_;
};
@ -138,6 +144,7 @@ class RpcReporter : public Reporter {
void ReportLatency(const ScenarioResult& result) override;
void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override;
std::unique_ptr<ReportQpsScenarioService::Stub> stub_;
};

@ -38,6 +38,7 @@
#include <grpc/support/cpu.h>
#include <vector>
#include "src/core/lib/surface/completion_queue.h"
#include "src/proto/grpc/testing/control.pb.h"
#include "src/proto/grpc/testing/messages.pb.h"
#include "test/core/end2end/data/ssl_test_data.h"
@ -49,7 +50,8 @@ namespace testing {
class Server {
public:
explicit Server(const ServerConfig& config) : timer_(new UsageTimer) {
explicit Server(const ServerConfig& config)
: timer_(new UsageTimer), last_reset_poll_count_(0) {
cores_ = gpr_cpu_num_cores();
if (config.port()) {
port_ = config.port();
@ -62,10 +64,13 @@ class Server {
ServerStats Mark(bool reset) {
UsageTimer::Result timer_result;
int cur_poll_count = GetPollCount();
int poll_count = cur_poll_count - last_reset_poll_count_;
if (reset) {
std::unique_ptr<UsageTimer> timer(new UsageTimer);
timer.swap(timer_);
timer_result = timer->Mark();
last_reset_poll_count_ = cur_poll_count;
} else {
timer_result = timer_->Mark();
}
@ -76,6 +81,7 @@ class Server {
stats.set_time_user(timer_result.user);
stats.set_total_cpu_time(timer_result.total_cpu_time);
stats.set_idle_cpu_time(timer_result.idle_cpu_time);
stats.set_cq_poll_count(poll_count);
return stats;
}
@ -106,10 +112,16 @@ class Server {
}
}
virtual int GetPollCount() {
// For sync server.
return 0;
}
private:
int port_;
int cores_;
std::unique_ptr<UsageTimer> timer_;
int last_reset_poll_count_;
};
std::unique_ptr<Server> CreateSynchronousServer(const ServerConfig& config);

@ -186,6 +186,14 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
shutdown_thread.join();
}
int GetPollCount() override {
int count = 0;
for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); cq++) {
count += grpc_get_cq_poll_num((*cq)->cq());
}
return count;
}
private:
void ShutdownThreadFunc() {
// TODO (vpai): Remove this deadline and allow Shutdown to finish properly

@ -29,16 +29,20 @@
licenses(["notice"]) # 3-clause BSD
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_binary")
package(default_visibility = ["//visibility:public"])
# The following builds a shared-object to confirm that grpc++_unsecure
# builds properly. Build-only is sufficient here
cc_binary(
grpc_cc_binary(
name = "testso.so",
srcs = [],
linkshared = 1,
deps = ["//:grpc++_unsecure"],
)
cc_library(
grpc_cc_library(
name = "test_config",
srcs = [
"test_config_cc.cc",
@ -46,14 +50,15 @@ cc_library(
hdrs = [
"test_config.h",
],
visibility = ["//test:__subpackages__"],
external_deps = [
"gflags",
],
deps = [
"//:gpr",
"//external:gflags",
],
)
cc_library(
grpc_cc_library(
name = "grpc++_proto_reflection_desc_db",
srcs = [
"proto_reflection_descriptor_database.cc",
@ -61,14 +66,13 @@ cc_library(
hdrs = [
"proto_reflection_descriptor_database.h",
],
visibility = ["//test:__subpackages__"],
deps = [
"//:grpc++_config_proto",
"//src/proto/grpc/reflection/v1alpha:reflection_proto",
],
)
cc_library(
grpc_cc_library(
name = "test_util",
srcs = [
"byte_buffer_proto_helper.cc",
@ -84,12 +88,57 @@ cc_library(
"subprocess.h",
"test_credentials_provider.h",
],
visibility = ["//test:__subpackages__"],
deps = [
"//:grpc++",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
],
external_deps = [
"protobuf",
],
)
grpc_cc_library(
name = "grpc_cli_libs",
srcs = [
"cli_call.cc",
"cli_credentials.cc",
"grpc_tool.cc",
"proto_file_parser.cc",
"service_describer.cc",
],
hdrs = [
"cli_call.h",
"cli_credentials.h",
"config_grpc_cli.h",
"grpc_tool.h",
"proto_file_parser.h",
"service_describer.h",
],
deps = [
"//:grpc++",
"//src/proto/grpc/reflection/v1alpha:reflection_proto",
":grpc++_proto_reflection_desc_db",
],
external_deps = [
"gflags",
"protobuf",
"protobuf_clib",
],
)
grpc_cc_library(
name = "metrics_server_lib",
srcs = [
"metrics_server.cc",
],
hdrs = [
"metrics_server.h",
],
deps = [
"//src/proto/grpc/testing:metrics_proto",
"//:grpc++",
],
)
cc_test(

@ -31,7 +31,7 @@
cd /d %~dp0
@rem extract input artifacts
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('../../../input_artifacts/csharp_nugets_windows_dotnetcli.zip', 'TestNugetFeed');"
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('../../../../input_artifacts/csharp_nugets_windows_dotnetcli.zip', 'TestNugetFeed');"
update_version.sh auto

@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM alpine:3.3
FROM alpine:3.5
# Install Git and basic packages.
RUN apk update && apk add \

@ -792,6 +792,7 @@ doc/service_config.md \
doc/status_ordering.md \
doc/statuscodes.md \
doc/stress_test_framework.md \
doc/unit_testing.md \
doc/wait-for-ready.md \
include/grpc++/alarm.h \
include/grpc++/channel.h \
@ -897,7 +898,8 @@ include/grpc/impl/codegen/sync_windows.h \
include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h
include/grpc/status.h \
include/grpc/support/workaround_list.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

@ -792,6 +792,7 @@ doc/service_config.md \
doc/status_ordering.md \
doc/statuscodes.md \
doc/stress_test_framework.md \
doc/unit_testing.md \
doc/wait-for-ready.md \
include/grpc++/alarm.h \
include/grpc++/channel.h \
@ -899,6 +900,7 @@ include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/workaround_list.h \
src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_args.h \
src/core/lib/channel/channel_stack.c \

@ -792,6 +792,7 @@ doc/service_config.md \
doc/status_ordering.md \
doc/statuscodes.md \
doc/stress_test_framework.md \
doc/unit_testing.md \
doc/wait-for-ready.md \
include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \

@ -792,6 +792,7 @@ doc/service_config.md \
doc/status_ordering.md \
doc/statuscodes.md \
doc/stress_test_framework.md \
doc/unit_testing.md \
doc/wait-for-ready.md \
include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \

@ -1,318 +0,0 @@
// Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//TODO(ericgribkoff) Depend on this directly from the instrumentation-proto
//repository.
syntax = "proto3";
package google.instrumentation;
option java_package = "com.google.instrumentation.stats.proto";
option java_outer_classname = "CensusProto";
// All the census protos.
//
// Nomenclature notes:
// * Capitalized names below (like View) are protos.
// * Protos which describe types are named with a Descriptor suffix (e.g.
// MesurementDescriptor).
//
// Census lets you define the type and description of the data being measured
// (e.g. the latency of an RPC or the number of CPU cycles spent on an
// operation using MeasurementDescriptor. As individual measurements (a double
// value) for are recorded, they are aggregated together into an
// Aggregation. There are two Aggregation types available: Distribution
// (describes the distribution of all measurements, possibly with a histogram)
// and IntervalStats (the count and mean of measurements across specified time
// periods). An Aggregation is described by an AggregationDescriptor.
//
// You can define how your measurements (described by a MeasurementDescriptor)
// are broken down by Tag values and which Aggregations to use through a
// ViewDescriptor. The output (all measurements broken down by tag values into
// specific Aggregations) is called a View.
// The following two types are copied from
// google/protobuf/{duration,timestamp}.proto. Ideally, we would be able to
// import them, but this causes compilation issues on C-based systems
// (e.g. https://koti.kapsi.fi/jpa/nanopb/), which cannot process the C++
// headers generated from the standard protobuf distribution. See the relevant
// proto files for full documentation of these types.
message Duration {
// Signed seconds of the span of time. Must be from -315,576,000,000
// to +315,576,000,000 inclusive.
int64 seconds = 1;
// Signed fractions of a second at nanosecond resolution of the span
// of time. Durations less than one second are represented with a 0
// `seconds` field and a positive or negative `nanos` field. For durations
// of one second or more, a non-zero value for the `nanos` field must be
// of the same sign as the `seconds` field. Must be from -999,999,999
// to +999,999,999 inclusive.
int32 nanos = 2;
}
message Timestamp {
// Represents seconds of UTC time since Unix epoch
// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
// 9999-12-31T23:59:59Z inclusive.
int64 seconds = 1;
// Non-negative fractions of a second at nanosecond resolution. Negative
// second values with fractions must still have non-negative nanos values
// that count forward in time. Must be from 0 to 999,999,999
// inclusive.
int32 nanos = 2;
}
// MeasurementDescriptor describes a data point (measurement) type.
message MeasurementDescriptor {
// A descriptive name, e.g. rpc_latency, cpu. Must be unique.
string name = 1;
// More detailed description of the resource, used in documentation.
string description = 2;
// Fundamental units of measurement supported by Census
// TODO(aveitch): expand this to include other S.I. units?
enum BasicUnit {
UNKNOWN = 0; // Implementations should not use this
SCALAR = 1; // Dimensionless
BITS = 2; // A single bit
BYTES = 3; // An 8-bit byte
SECONDS = 4; // S.I. unit
CORES = 5; // CPU core usage
MAX_UNITS = 6; // Last defined value; implementations should only use
// this for validation.
}
// MeasurementUnit lets you build compound units of the form
// 10^n * (A * B * ...) / (X * Y * ...),
// where the elements in the numerator and denominator are all BasicUnits. A
// MeasurementUnit must have at least one BasicUnit in its numerator.
//
// To specify multiplication in the numerator or denominator, simply specify
// multiple numerator or denominator fields. For example:
//
// - byte-seconds (i.e. bytes * seconds):
// numerator: BYTES
// numerator: SECS
//
// - events/sec^2 (i.e. rate of change of events/sec):
// numerator: SCALAR
// denominator: SECS
// denominator: SECS
//
// To specify multiples (in power of 10) of units, specify a non-zero
// 'power10' value, for example:
//
// - MB/s (i.e. megabytes / s):
// power10: 6
// numerator: BYTES
// denominator: SECS
//
// - nanoseconds
// power10: -9
// numerator: SECS
message MeasurementUnit {
int32 power10 = 1;
repeated BasicUnit numerators = 2;
repeated BasicUnit denominators = 3;
}
// The units used by this type of measurement.
MeasurementUnit unit = 3;
}
// An aggregation summarizes a series of individual measurements. There are
// two types of aggregation (IntervalAggregation and DistributionAggregation),
// unique types of each can be set using descriptors for each.
// DistributionAggregation contains summary statistics for a population of
// values and, optionally, a histogram representing the distribution of those
// values across a specified set of histogram buckets, as defined in
// DistributionAggregationDescriptor.bucket_bounds.
//
// The summary statistics are the count, mean, minimum, and the maximum of the
// set of population of values.
//
// Although it is not forbidden, it is generally a bad idea to include
// non-finite values (infinities or NaNs) in the population of values, as this
// will render the `mean` field meaningless.
message DistributionAggregation {
// The number of values in the population. Must be non-negative.
int64 count = 1;
// The arithmetic mean of the values in the population. If `count` is zero
// then this field must be zero.
double mean = 2;
// The sum of the values in the population. If `count` is zero then this
// field must be zero.
double sum = 3;
// Describes a range of population values.
message Range {
// The minimum of the population values.
double min = 1;
// The maximum of the population values.
double max = 2;
}
// The range of the population values. If `count` is zero, this field will not
// be defined.
Range range = 4;
// A Distribution may optionally contain a histogram of the values in the
// population. The histogram is given in `bucket_count` as counts of values
// that fall into one of a sequence of non-overlapping buckets, as described
// by `DistributionAggregationDescriptor.bucket_boundaries`. The sum of the
// values in `bucket_counts` must equal the value in `count`.
//
// Bucket counts are given in order under the numbering scheme described
// above (the underflow bucket has number 0; the finite buckets, if any,
// have numbers 1 through N-2; the overflow bucket has number N-1).
//
// The size of `bucket_count` must be no greater than N as defined in
// `bucket_boundaries`.
//
// Any suffix of trailing zero bucket_count fields may be omitted.
repeated int64 bucket_counts = 5;
// Tags associated with this DistributionAggregation. These will be filled
// in based on the View specification.
repeated Tag tags = 6;
}
message DistributionAggregationDescriptor {
// A Distribution may optionally contain a histogram of the values in the
// population. The bucket boundaries for that histogram are described by
// `bucket_bounds`. This defines `size(bucket_bounds) + 1` (= N)
// buckets. The boundaries for bucket index i are:
//
// [-infinity, bucket_bounds[i]) for i == 0
// [bucket_bounds[i-1], bucket_bounds[i]) for 0 < i < N-2
// [bucket_bounds[i-1], +infinity) for i == N-1
//
// i.e. an underflow bucket (number 0), zero or more finite buckets (1
// through N - 2, and an overflow bucket (N - 1), with inclusive lower
// bounds and exclusive upper bounds.
//
// If `bucket_bounds` has no elements (zero size), then there is no
// histogram associated with the Distribution. If `bucket_bounds` has only
// one element, there are no finite buckets, and that single element is the
// common boundary of the overflow and underflow buckets. The values must
// be monotonically increasing.
repeated double bucket_bounds = 1;
}
// An IntervalAggreation records summary stats over various time
// windows. These stats are approximate, with the degree of accuracy
// controlled by setting the n_sub_intervals parameter in the
// IntervalAggregationDescriptor.
message IntervalAggregation {
// Summary statistic over a single time interval.
message Interval {
// The interval duration. Must be positive.
Duration interval_size = 1;
// Approximate number of measurements recorded in this interval.
double count = 2;
// The cumulative sum of measurements in this interval.
double sum = 3;
}
// Full set of intervals for this aggregation.
repeated Interval intervals = 1;
// Tags associated with this IntervalAggregation. These will be filled in
// based on the View specification.
repeated Tag tags = 2;
}
// An IntervalAggreationDescriptor specifies time intervals for an
// IntervalAggregation.
message IntervalAggregationDescriptor {
// Number of internal sub-intervals to use when collecting stats for each
// interval. The max error in interval measurements will be approximately
// 1/n_sub_intervals (although in practice, this will only be approached in
// the presence of very large and bursty workload changes), and underlying
// memory usage will be roughly proportional to the value of this
// field. Must be in the range [2, 20]. A value of 5 will be used if this is
// unspecified.
int32 n_sub_intervals = 1;
// The size of each interval, as a time duration. Must have at least one
// element.
repeated Duration interval_sizes = 2;
}
// A Tag: key-value pair.
message Tag {
string key = 1;
string value = 2;
}
// A ViewDescriptor specifies an AggregationDescriptor and a set of tag
// keys. Views instantiated from this descriptor will contain Aggregations
// broken down by the unique set of matching tag values for each measurement.
message ViewDescriptor {
// Name of view. Must be unique.
string name = 1;
// More detailed description, for documentation purposes.
string description = 2;
// Name of a MeasurementDescriptor to be used for this view.
string measurement_descriptor_name = 3;
// Aggregation type to associate with View.
oneof aggregation {
IntervalAggregationDescriptor interval_aggregation = 4;
DistributionAggregationDescriptor distribution_aggregation = 5;
}
// Tag keys to match with a given measurement. If no keys are specified,
// then all stats are recorded. Keys must be unique.
repeated string tag_keys = 6;
}
// DistributionView contains all aggregations for a view specified using a
// DistributionAggregationDescriptor.
message DistributionView {
// Aggregations - each will have a unique set of tag values for the tag_keys
// associated with the corresponding View.
repeated DistributionAggregation aggregations = 1;
// Start and end timestamps over which aggregations was accumulated.
Timestamp start = 2;
Timestamp end = 3;
}
// IntervalView contains all aggregations for a view specified using a
// IntervalAggregationDescriptor.
message IntervalView {
// Aggregations - each will have a unique set of tag values for the tag_keys
// associated with the corresponding View.
repeated IntervalAggregation aggregations = 1;
}
// A View contains the aggregations based on a ViewDescriptor.
message View {
// ViewDescriptor name associated with this set of View.
string view_name = 1;
oneof view {
DistributionView distribution_view = 2;
IntervalView interval_view = 3;
}
}

@ -1,185 +0,0 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <string>
#include <google/protobuf/util/json_util.h>
#include <grpc++/grpc++.h>
#include <grpc/support/log.h>
#include "gflags/gflags.h"
/* #include "mongoose.h" */
// TODO (makdharma): remove local copies of these protos
#include "tools/grpcz/census.grpc.pb.h"
#include "tools/grpcz/monitoring.grpc.pb.h"
DEFINE_string(
grpcz_server, "127.0.0.1:8080",
"Unix domain socket path (e.g. unix://tmp/grpcz.sock) or IP address"
"(host:port) where grpcz server is running.");
DEFINE_string(http_port, "8000",
"Port id for accessing the HTTP server that renders /grpcz page");
DEFINE_bool(print_to_console, false,
"print the JSON retreived from grpcz server and quit");
using grpc::Channel;
using grpc::ClientContext;
using grpc::Status;
using ::grpc::instrumentation::v1alpha::CanonicalRpcStats;
using ::grpc::instrumentation::v1alpha::Monitoring;
static const std::string static_html_header =
"<!DOCTYPE html> <html> <head> <style> \
table { border-collapse: collapse; width: 100%; } \
table, td, th { border: 1px solid black; } \
</style> </head> <body>\
<div id='stats' data-stats='";
static const std::string static_html_footer =
"' class='hidden'></div>\
<h1>GRPCZ Statistics</h1> <div id='table'> </div> \
<script> \
var canonical_stats = JSON.parse(\
document.getElementById('stats').getAttribute('data-stats')); \
var table = document.createElement('table'); \
if (canonical_stats['Error Message'] != undefined) { \
document.getElementById('table').innerHTML = canonical_stats['Error Message']; } \
else {\
for (var key in canonical_stats) { \
name = canonical_stats[key]['view']['viewName']; \
distribution = canonical_stats[key]['view']['distributionView']; \
interval = canonical_stats[key]['view']['intervalView']; \
value = (interval == undefined) ? \
JSON.stringify(distribution, null, ' ') : \
JSON.stringify(interval, null, ' '); \
var row = table.insertRow(-1); \
var col1 = row.insertCell(0); \
var col2 = row.insertCell(1); \
col1.innerHTML = name; \
col2.innerHTML = '<pre>' + value + '</pre>'; \
} \
document.getElementById('table').appendChild(table); \
}\
</script> </body> </html>";
class GrpczClient {
public:
GrpczClient(std::shared_ptr<Channel> channel)
: stub_(Monitoring::NewStub(channel)) {}
std::string GetStatsAsJson() {
const ::google::protobuf::Empty request;
CanonicalRpcStats reply;
ClientContext context;
Status status = stub_->GetCanonicalRpcStats(&context, request, &reply);
if (status.ok()) {
std::string json_str;
::google::protobuf::util::MessageToJsonString(reply, &json_str);
return json_str;
} else {
static const std::string error_message_json =
"{\"Error Message\":\"" + status.error_message() + "\"}";
gpr_log(GPR_DEBUG, "%d: %s", status.error_code(),
status.error_message().c_str());
return error_message_json;
}
}
private:
std::unique_ptr<Monitoring::Stub> stub_;
};
std::unique_ptr<GrpczClient> g_grpcz_client;
/*
static struct mg_serve_http_opts s_http_server_opts;
static void ev_handler(struct mg_connection *nc, int ev, void *p) {
if (ev == MG_EV_HTTP_REQUEST) {
mg_serve_http(nc, (struct http_message *)p, s_http_server_opts);
}
}
static void grpcz_handler(struct mg_connection *nc, int ev, void *ev_data) {
(void)ev;
(void)ev_data;
gpr_log(GPR_INFO, "fetching grpcz stats from %s", FLAGS_grpcz_server.c_str());
std::string json_str = g_grpcz_client->GetStatsAsJson();
std::string rendered_html =
static_html_header + json_str + static_html_footer;
mg_printf(nc, "HTTP/1.0 200 OK\r\n\r\n%s", rendered_html.c_str());
nc->flags |= MG_F_SEND_AND_CLOSE;
}
*/
int main(int argc, char **argv) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
// Create a client
g_grpcz_client.reset(new GrpczClient(grpc::CreateChannel(
FLAGS_grpcz_server, grpc::InsecureChannelCredentials())));
if (FLAGS_print_to_console) {
// using GPR_ERROR since this is the default verbosity. _DEBUG or _INFO
// won't print unless GRPC_VERBOSITY env var is set appropriately, which
// might confuse users of this utility.
gpr_log(GPR_ERROR, "%s\n", g_grpcz_client->GetStatsAsJson().c_str());
return 0;
}
/*
// Set up a mongoose webserver handler
struct mg_mgr mgr;
mg_mgr_init(&mgr, NULL);
gpr_log(GPR_INFO, "Starting grpcz web server on port %s\n",
FLAGS_http_port.c_str());
struct mg_connection *nc = mg_bind(&mgr, FLAGS_http_port.c_str(), ev_handler);
if (nc == NULL) {
gpr_log(GPR_ERROR, "Failed to create listener on port %s\n",
FLAGS_http_port.c_str());
return -1;
}
mg_register_http_endpoint(nc, "/grpcz", grpcz_handler);
mg_set_protocol_http_websocket(nc);
// Poll in a loop and serve /grpcz pages
for (;;) {
static const int k_sleep_millis = 100;
mg_mgr_poll(&mgr, k_sleep_millis);
}
mg_mgr_free(&mgr);
*/
return 0;
}

@ -1,156 +0,0 @@
// Copyright 2017, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file defines an interface for exporting monitoring information
// out of gRPC servers.
syntax = "proto3";
// TODO(ericgribkoff) Figure out how to manage the external Census proto
// dependency.
import "tools/grpcz/census.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
package grpc.instrumentation.v1alpha;
option java_multiple_files = true;
option java_package = "io.grpc.instrumentation.v1alpha";
option java_outer_classname = "MonitoringProto";
service Monitoring {
// Return canonical RPC stats
rpc GetCanonicalRpcStats(google.protobuf.Empty) returns (CanonicalRpcStats) {
}
// Query the server for specific stats
rpc GetStats(StatsRequest) returns (StatsResponse) {
}
// Request the server to stream back snapshots of the requested stats
rpc WatchStats(StatsRequest) returns (stream StatsResponse) {
}
// Return request traces.
rpc GetRequestTraces(TraceRequest) returns(TraceResponse) {
// TODO(aveitch): Please define the messages here
}
// Return application-defined groups of monitoring data.
// This is a low level facility to allow extension of the monitoring API to
// application-specific monitoring data. Frameworks may use this to define
// additional groups of monitoring data made available by servers.
rpc GetCustomMonitoringData(MonitoringDataGroup)
returns (CustomMonitoringData) {
}
}
// Canonical RPC stats exported by gRPC.
message CanonicalRpcStats {
StatsResponse rpc_client_errors = 1;
StatsResponse rpc_client_completed_rpcs = 2;
StatsResponse rpc_client_started_rpcs = 3;
StatsResponse rpc_client_elapsed_time = 4;
StatsResponse rpc_client_server_elapsed_time = 5;
StatsResponse rpc_client_request_bytes = 6;
StatsResponse rpc_client_response_bytes = 7;
StatsResponse rpc_client_request_count = 8;
StatsResponse rpc_client_response_count = 9;
StatsResponse rpc_server_errors = 10;
StatsResponse rpc_server_completed_rpcs = 11;
StatsResponse rpc_server_server_elapsed_time = 12;
StatsResponse rpc_server_request_bytes = 13;
StatsResponse rpc_server_response_bytes = 14;
StatsResponse rpc_server_request_count = 15;
StatsResponse rpc_server_response_count = 16;
StatsResponse rpc_server_elapsed_time = 17;
//TODO(ericgribkoff) Add minute-hour interval stats.
}
// This message is sent when requesting a set of stats (Census Views) from
// a client system, as part of the MonitoringService API's.
message StatsRequest {
// An optional set of ViewDescriptor names. Only Views using these
// descriptors will be sent back in the response. If no names are provided,
// then all Views present in the client system will be included in every
// response. If measurement_names is also provided, then Views matching the
// intersection of the two are returned.
// TODO(aveitch): Consider making this a list of regexes or prefix matches in
// the future.
repeated string view_names = 1;
// An optional set of MeasurementDescriptor names. Only Views using these
// descriptors will be sent back in the response. If no names are provided,
// then all Views present in the client system will be included in every
// response. If view_names is also provided, then Views matching the
// intersection of the two are returned.
// TODO(aveitch): Consider making this a list of regexes or prefix matches in
// the future.
repeated string measurement_names = 2;
// By default, the MeasurementDescriptors and ViewDescriptors corresponding to
// the Views that are returned in a StatsResponse will be included in the
// first such response. Set this to true to have them not sent.
bool dont_include_descriptors_in_first_response = 3;
}
// This message contains all information relevant to a single View. It is the
// return type for GetStats and WatchStats, and used in CanonicalRpcStats.
message StatsResponse {
// A StatsResponse can optionally contain the MeasurementDescriptor and
// ViewDescriptor for the View. These will be sent in the first WatchStats
// response, or all GetStats and GetCanonicalRpcStats responses. These will
// not be set for {Get,Watch}Stats if
// dont_include_descriptors_in_first_response is set to true in the
// StatsRequest.
google.instrumentation.MeasurementDescriptor measurement_descriptor = 1;
google.instrumentation.ViewDescriptor view_descriptor = 2;
// The View data.
google.instrumentation.View view = 3;
}
message TraceRequest {
// TODO(aveitch): Complete definition of this type
}
message TraceResponse {
// TODO(aveitch): Complete definition of this type
}
message MonitoringDataGroup {
string name = 1; // name of a group of monitoring data
}
// The wrapper for custom monitoring data.
message CustomMonitoringData {
// can be any application specific monitoring data
google.protobuf.Any contents = 1;
}

@ -33,6 +33,10 @@
# Need to increase open files limit for c tests
ulimit -n 32768
# Move docker's storage location to scratch disk so we don't run out of space.
echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker
sudo service docker restart
# Download Docker images from DockerHub
export DOCKERHUB_ORGANIZATION=grpctesting

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save