Skip to content

Commit

Permalink
fuzz: tag trivial fuzzers with no_fuzz. (envoyproxy#4156)
Browse files Browse the repository at this point in the history
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 <htuch@google.com>
  • Loading branch information
htuch committed Aug 15, 2018
1 parent 27fb1d3 commit f06e958
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bazel/envoy_build_system.bzl
Expand Up @@ -233,7 +233,7 @@ def envoy_cc_binary(
)

# Envoy C++ fuzz test targes. These are not included in coverage runs.
def envoy_cc_fuzz_test(name, corpus, deps = [], **kwargs):
def envoy_cc_fuzz_test(name, corpus, deps = [], tags = [], **kwargs):
test_lib_name = name + "_lib"
envoy_cc_test_library(
name = test_lib_name,
Expand All @@ -255,6 +255,7 @@ def envoy_cc_fuzz_test(name, corpus, deps = [], **kwargs):
"//test/fuzz:main",
],
}),
tags = tags,
)
native.cc_binary(
name = name + "_driverless",
Expand All @@ -263,7 +264,7 @@ def envoy_cc_fuzz_test(name, corpus, deps = [], **kwargs):
linkstatic = 1,
testonly = 1,
deps = [":" + test_lib_name],
tags = ["manual"],
tags = ["manual"] + tags,
)

# Envoy C++ test targets should be specified with this function.
Expand Down
4 changes: 4 additions & 0 deletions test/common/common/BUILD
Expand Up @@ -40,13 +40,17 @@ envoy_cc_fuzz_test(
name = "base64_fuzz_test",
srcs = ["base64_fuzz_test.cc"],
corpus = "base64_corpus",
# Fuzzer is stable, no bugs, simple test target; avoid emitting CO2.
tags = ["no_fuzz"],
deps = ["//source/common/common:base64_lib"],
)

envoy_cc_fuzz_test(
name = "utility_fuzz_test",
srcs = ["utility_fuzz_test.cc"],
corpus = "utility_corpus",
# Fuzzer is stable, no bugs, simple test target; avoid emitting CO2.
tags = ["no_fuzz"],
deps = ["//source/common/common:utility_lib"],
)

Expand Down
2 changes: 2 additions & 0 deletions test/common/protobuf/BUILD
Expand Up @@ -24,5 +24,7 @@ envoy_cc_fuzz_test(
name = "value_util_fuzz_test",
srcs = ["value_util_fuzz_test.cc"],
corpus = "value_util_corpus",
# Fuzzer is stable, no bugs, simple test target; avoid emitting CO2.
tags = ["no_fuzz"],
deps = ["//source/common/protobuf:utility_lib"],
)

0 comments on commit f06e958

Please sign in to comment.