Skip to content

Commit

Permalink
WIP: Updating fuzz build file to run all the fuzzers in chaoscenter
Browse files Browse the repository at this point in the history
Signed-off-by: Saranya-jena <[email protected]>
  • Loading branch information
Saranya-jena committed Feb 23, 2024
1 parent 6cfff16 commit da30547
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions chaoscenter/fuzz_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,26 @@
# limitations under the License.
#
################################################################################
cd chaoscenter/graphql/server && go mod download
go install github.com/AdamKorcz/go-118-fuzz-build@latest
go get github.com/AdamKorcz/go-118-fuzz-build/testing
# cd chaoscenter/graphql/server && go mod download
# go install github.com/AdamKorcz/go-118-fuzz-build@latest
# go get github.com/AdamKorcz/go-118-fuzz-build/testing

compile_native_go_fuzzer $(pwd)/pkg/environment/handler FuzzTestGetEnvironment test-fuzz
# compile_native_go_fuzzer $(pwd)/pkg/environment/handler FuzzTestGetEnvironment test-fuzz


# grep --line-buffered --include '*_test_fuzz.go' -Pr 'func Fuzz.*\(.* \*testing\.F' | sed -E 's/(func Fuzz(.*)\(.*)/\2/' | xargs -I{} sh -c '
# file="$(echo "{}" | cut -d: -f1)"
# folder="$(dirname $file)"
# func="Fuzz$(echo "{}" | cut -d: -f2)"
# compile_native_go_fuzzer github.com/crossplane/crossplane/$folder $func $func
# '


export GO_MOD_PATHS_MAPPING=( "graphql/server")

for dir in "${GO_MOD_PATHS_MAPPING[@]}"; do
(cd ${dir} && go mod download &&
go install github.com/AdamKorcz/go-118-fuzz-build@latest &&
go get github.com/AdamKorcz/go-118-fuzz-build/testing &&
./test-fuzz.sh $(pwd)/pkg/environment/test FuzzTestGetEnvironment test-fuzz)
done

0 comments on commit da30547

Please sign in to comment.