diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d19ea9b1b3..40c64da4a2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,7 +9,7 @@ env: GO_VERSION: '1.21.1' jobs: - e2e-tests: + test-e2e: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -24,6 +24,17 @@ jobs: run: | mkdir -p $HOME/.kube echo "${KUBECONFIG_FILE}" > $HOME/.kube/config - - name: Run e2e tests run: make test-e2e + + test-fuzz: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run fuzz tests + run: make test-fuzz diff --git a/Makefile b/Makefile index f9a9375de4..27dbcec62d 100644 --- a/Makefile +++ b/Makefile @@ -141,6 +141,10 @@ test-coverage: @export VERSION=$(VERSION); bash -x scripts/test_cover.sh .PHONY: test-coverage +test-fuzz: + bash -x scripts/test_fuzz.sh +.PHONY: test-fuzz + ## txsim-install: Install the tx simulator. txsim-install: @echo "--> Installing tx simulator" diff --git a/scripts/test_fuzz.sh b/scripts/test_fuzz.sh new file mode 100755 index 0000000000..4d65c4f06a --- /dev/null +++ b/scripts/test_fuzz.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e + +echo "Running fuzz tests..." +# manually specify the tests to fuzz since go toolchain doesn't support +# fuzzing multiple packages with multiple fuzz tests +go test -fuzz=FuzzNewInfoByte -fuzztime 1m ./pkg/shares +go test -fuzz=FuzzValidSequenceLen -fuzztime 1m ./pkg/shares +go test -fuzz=FuzzSquare -fuzztime 5m ./pkg/square +go test -fuzz=FuzzPFBGasEstimation -fuzztime 3m ./x/blob/types