Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 27, 2025
1 parent f5e6592 commit 13acd27
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions test/core/end2end/grpc_core_end2end_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@
Generate one e2e test & associated fuzzer
"""

load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_fuzz_test")
load("//bazel:grpc_build_system.bzl", "grpc_cc_test")

END2END_TEST_DATA = [
"//src/core/tsi/test_creds:ca.pem",
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
]

def if_fuzztest_supported(true_value, false_value):
return select({
"//:windows": false_value,
"//:windows_msvc": false_value,
"//:windows_clang": false_value,
"//conditions:default": true_value,
})

def grpc_core_end2end_test(name, shard_count = 10, enable_fuzzing = True, tags = [], flaky = False):
"""Generate one core end2end test
Expand All @@ -37,20 +45,26 @@ def grpc_core_end2end_test(name, shard_count = 10, enable_fuzzing = True, tags =
if len(name) > 60:
fail("test name %s too long" % name)

grpc_fuzz_test(
grpc_cc_test(
name = name + "_test",
srcs = [
"tests/%s.cc" % name,
],
external_deps = [
"absl/log:log",
"gtest",
"fuzztest",
"fuzztest_main",
],
data = END2END_TEST_DATA,
shard_count = shard_count,
defines = [] if enable_fuzzing else ["GRPC_END2END_TEST_NO_FUZZER"],
defines = if_fuzztest_supported(
[] if enable_fuzzing else ["GRPC_END2END_TEST_NO_FUZZER"],
[],
),
tags = tags + [
"grpc-fuzzer",
"grpc-fuzztest",
"bazel_only",
],
deps = [
"cq_verifier",
"end2end_test_lib",
Expand Down Expand Up @@ -95,5 +109,8 @@ def grpc_core_end2end_test(name, shard_count = 10, enable_fuzzing = True, tags =
"//test/core/test_util:fake_stats_plugin",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:test_lb_policies",
],
] + if_fuzztest_supported(
["//third_party:fuzztest", "//third_party:fuzztest_main"],
[],
),
)

0 comments on commit 13acd27

Please sign in to comment.