-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add fuzz test targets to ci #7949
Changes from 3 commits
0c0953a
ee200ce
35bbf8c
f2833fc
56255d9
94c46bb
0045071
545814f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,11 +85,19 @@ CI_TARGET=$1 | |
|
||
if [[ $# -gt 1 ]]; then | ||
shift | ||
# If this is a fuzz test, add _with_libfuzzer | ||
if [[ "$CI_TARGET" == "bazel.fuzz" ]]; then | ||
FUZZ_TEST_TARGETS=$*"_with_libfuzzer" | ||
fi | ||
TEST_TARGETS=$* | ||
else | ||
TEST_TARGETS=//test/... | ||
if [[ "$CI_TARGET" == "bazel.fuzz" ]]; then | ||
htuch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FUZZ_TEST_TARGETS="$(bazel query "attr('tags','fuzzer',//test/...)")" | ||
fi | ||
fi | ||
|
||
|
||
if [[ "$CI_TARGET" == "bazel.release" ]]; then | ||
# When testing memory consumption, we want to test against exact byte-counts | ||
# where possible. As these differ between platforms and compile options, we | ||
|
@@ -252,6 +260,14 @@ elif [[ "$CI_TARGET" == "bazel.coverity" ]]; then | |
"${ENVOY_BUILD_DIR}"/envoy-coverity-output.tgz \ | ||
"${ENVOY_DELIVERY_DIR}"/envoy-coverity-output.tgz | ||
exit 0 | ||
elif [[ "$CI_TARGET" == "bazel.fuzz" ]]; then | ||
htuch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
setup_clang_toolchain | ||
echo "bazel ASAN libFuzzer build with fuzz tests ${FUZZ_TEST_TARGETS}" | ||
echo "Building envoy fuzzers and executing 100 fuzz iterations..." | ||
for t in ${FUZZ_TEST_TARGETS}; do | ||
bazel_with_collection run ${BAZEL_BUILD_OPTIONS} --config=asan-fuzzer $t -- -runs=10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to run multiple target at same time, otherwise the CI time will be long, and not utilizing the resources we have in RBE. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like build and test can take multiple test targets, but run can't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then my next question is: can you make fuzzer target as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes! That worked swimmingly with something like It seems like it's linking dependencies now with ubsan (so it's crashing on ubsan errors in external libraries). Is this a difference between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That shouldn't, though I don't know why are you seeing this, can you push your change so I can see what's happening in CI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, the errors look like they should probably be caught by the fuzzer after the 10 iterations in at least some of the fuzz tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, this is because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Yeah, those are legitimate UBSan faults, but not in our test code. |
||
done; | ||
exit 0 | ||
elif [[ "$CI_TARGET" == "fix_format" ]]; then | ||
echo "fix_format..." | ||
./tools/check_format.py fix | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this two ifs here? Move them to below in
elif [[ "$CI_TARGET" == "bazel.fuzz" ]]; then
and ingest from $TEST_TARGETS?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ingested from $TEST_TARGET, the only awkward thing about it is that the user has to specify the "_with_libfuzzer" name for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's fine, at least wildcards like
//test/server/...
works, (which didn't work with previous one), it is hard to make this perfect anyway.