From 7cbb3fb7b3087797ded62c164f02496974a464f1 Mon Sep 17 00:00:00 2001 From: Mira Ressel Date: Tue, 27 Jun 2023 17:41:33 +0200 Subject: [PATCH 1/3] ci(cargo-hfuzz): iterate over multiple fuzzer crates --- scripts/ci/gitlab/pipeline/test.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/ci/gitlab/pipeline/test.yml b/scripts/ci/gitlab/pipeline/test.yml index 2e5495cb82a3e..999235635d9ce 100644 --- a/scripts/ci/gitlab/pipeline/test.yml +++ b/scripts/ci/gitlab/pipeline/test.yml @@ -463,6 +463,8 @@ cargo-hfuzz: HFUZZ_BUILD_ARGS: > --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs" --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981" + SUBSTRATE_FUZZER_DIRS: > + primitives/arithmetic/fuzzer artifacts: name: "hfuzz-$CI_COMMIT_SHORT_SHA" expire_in: 7 days @@ -470,9 +472,17 @@ cargo-hfuzz: paths: - primitives/arithmetic/fuzzer/hfuzz_workspace/ script: - - cd ./primitives/arithmetic/fuzzer - rusty-cachier snapshot create - - cargo hfuzz build + - for dir in ${SUBSTRATE_FUZZER_DIRS}; do + pushd "${dir}"; + cargo hfuzz build; + popd; + done - rusty-cachier cache upload - - for target in $(cargo read-manifest | jq -r '.targets | .[] | .name'); do - cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; }; done + - for dir in ${SUBSTRATE_FUZZER_DIRS}; do + pushd "${dir}"; + for target in $(cargo read-manifest | jq -r '.targets | .[] | .name'); do + cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; }; + done; + popd; + done; From 1075160c5e9fef4e6d034e1c01c48ba91b6deb37 Mon Sep 17 00:00:00 2001 From: Mira Ressel Date: Tue, 27 Jun 2023 18:05:12 +0200 Subject: [PATCH 2/3] ci(cargo-hfuzz): run frame/nomination-pools/fuzzer in ci --- scripts/ci/gitlab/pipeline/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/gitlab/pipeline/test.yml b/scripts/ci/gitlab/pipeline/test.yml index 999235635d9ce..962bf7bc24650 100644 --- a/scripts/ci/gitlab/pipeline/test.yml +++ b/scripts/ci/gitlab/pipeline/test.yml @@ -464,12 +464,14 @@ cargo-hfuzz: --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs" --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981" SUBSTRATE_FUZZER_DIRS: > + frame/nomination-pools/fuzzer primitives/arithmetic/fuzzer artifacts: name: "hfuzz-$CI_COMMIT_SHORT_SHA" expire_in: 7 days when: on_failure paths: + - frame/nomination-pools/fuzzer/hfuzz_workspace/ - primitives/arithmetic/fuzzer/hfuzz_workspace/ script: - rusty-cachier snapshot create From 527301cc8091c721237f6e3a31ae95e45b4e96ba Mon Sep 17 00:00:00 2001 From: Mira Ressel Date: Tue, 27 Jun 2023 18:12:36 +0200 Subject: [PATCH 3/3] ci(cargo-hfuzz): allow this job to fail for now --- scripts/ci/gitlab/pipeline/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci/gitlab/pipeline/test.yml b/scripts/ci/gitlab/pipeline/test.yml index 962bf7bc24650..54510e4a2f2fa 100644 --- a/scripts/ci/gitlab/pipeline/test.yml +++ b/scripts/ci/gitlab/pipeline/test.yml @@ -473,6 +473,7 @@ cargo-hfuzz: paths: - frame/nomination-pools/fuzzer/hfuzz_workspace/ - primitives/arithmetic/fuzzer/hfuzz_workspace/ + allow_failure: true script: - rusty-cachier snapshot create - for dir in ${SUBSTRATE_FUZZER_DIRS}; do