Skip to content

Commit

Permalink
ci: add fuzz tests to nightly run (#2787)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters authored Oct 30, 2023
1 parent 0cc6a54 commit 1f0a521
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
GO_VERSION: '1.21.1'

jobs:
e2e-tests:
test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions scripts/test_fuzz.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1f0a521

Please sign in to comment.