Skip to content

Commit

Permalink
feat: Fuzz Tests (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtriley2p authored Jan 28, 2025
1 parent cabcc66 commit cca3cb3
Show file tree
Hide file tree
Showing 9 changed files with 2,815 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.34.0
toolchain: 0.36.0

- name: Install bb
run: |
npm install -g bbup
bbup -nv 0.34.0
bbup -nv 0.36.0
- name: Build Noir benchmark programs
run: nargo export
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Compare gates reports
id: gates_diff
uses: noir-lang/noir-gates-diff@1931aaaa848a1a009363d6115293f7b7fc72bb87
uses: noir-lang/noir-gates-diff@7e4ddaa91c69380f15ccba514eac17bc7432a8cc
with:
report: gates_report.json
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
test:
name: Test on Nargo ${{matrix.toolchain}}
name: Test on Nargo Nightly
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: v0.34.0
MINIMUM_NOIR_VERSION: v0.36.0

jobs:
noir-version-list:
Expand All @@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout sources
id: get_versions
run: |
run: |
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
echo "versions=$VERSIONS"
Expand Down Expand Up @@ -50,6 +50,32 @@ jobs:
- name: Run Noir tests
run: nargo test

rust-equivalence-tests:
name: Test for equivalence against Rust impl
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}

- name: Install Cargo
uses: dtolnay/[email protected]
with:
targets: x86_64-unknown-linux-gnu

- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
with:
key: x86_64-unknown-linux-gnu
cache-on-failure: true

- name: Export and Test Noir Functions
run: ./scripts/fuzz-test.sh

format:
runs-on: ubuntu-latest
steps:
Expand All @@ -73,6 +99,7 @@ jobs:
if: ${{ always() }}
needs:
- test
- rust-equivalence-tests
- format

steps:
Expand Down
Loading

0 comments on commit cca3cb3

Please sign in to comment.