Skip to content

Commit f06e958

Browse files
authored
fuzz: tag trivial fuzzers with no_fuzz. (#4156)
In conjunction with google/oss-fuzz#1712, this allows us to elide trivial fuzzers on ClusterFuzz. This should save CPU cycles and project quota (depending on the nuances of how they schedule). Risk level: Low Testing: Building with oss-fuzz Docker image. Signed-off-by: Harvey Tuch <[email protected]>
1 parent 27fb1d3 commit f06e958

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

bazel/envoy_build_system.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def envoy_cc_binary(
233233
)
234234

235235
# Envoy C++ fuzz test targes. These are not included in coverage runs.
236-
def envoy_cc_fuzz_test(name, corpus, deps = [], **kwargs):
236+
def envoy_cc_fuzz_test(name, corpus, deps = [], tags = [], **kwargs):
237237
test_lib_name = name + "_lib"
238238
envoy_cc_test_library(
239239
name = test_lib_name,
@@ -255,6 +255,7 @@ def envoy_cc_fuzz_test(name, corpus, deps = [], **kwargs):
255255
"//test/fuzz:main",
256256
],
257257
}),
258+
tags = tags,
258259
)
259260
native.cc_binary(
260261
name = name + "_driverless",
@@ -263,7 +264,7 @@ def envoy_cc_fuzz_test(name, corpus, deps = [], **kwargs):
263264
linkstatic = 1,
264265
testonly = 1,
265266
deps = [":" + test_lib_name],
266-
tags = ["manual"],
267+
tags = ["manual"] + tags,
267268
)
268269

269270
# Envoy C++ test targets should be specified with this function.

test/common/common/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ envoy_cc_fuzz_test(
4040
name = "base64_fuzz_test",
4141
srcs = ["base64_fuzz_test.cc"],
4242
corpus = "base64_corpus",
43+
# Fuzzer is stable, no bugs, simple test target; avoid emitting CO2.
44+
tags = ["no_fuzz"],
4345
deps = ["//source/common/common:base64_lib"],
4446
)
4547

4648
envoy_cc_fuzz_test(
4749
name = "utility_fuzz_test",
4850
srcs = ["utility_fuzz_test.cc"],
4951
corpus = "utility_corpus",
52+
# Fuzzer is stable, no bugs, simple test target; avoid emitting CO2.
53+
tags = ["no_fuzz"],
5054
deps = ["//source/common/common:utility_lib"],
5155
)
5256

test/common/protobuf/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ envoy_cc_fuzz_test(
2424
name = "value_util_fuzz_test",
2525
srcs = ["value_util_fuzz_test.cc"],
2626
corpus = "value_util_corpus",
27+
# Fuzzer is stable, no bugs, simple test target; avoid emitting CO2.
28+
tags = ["no_fuzz"],
2729
deps = ["//source/common/protobuf:utility_lib"],
2830
)

0 commit comments

Comments
 (0)