Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

Fuzz

Fuzz #67

Workflow file for this run

name: Fuzz
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
schedule:
# Run fuzzing daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
jobs:
fuzz-short:
name: Fuzz (30s)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
- name: Run fuzz tests (short)
run: |
go test -fuzz=FuzzCodec -fuzztime=30s ./internal/encoding
go test -fuzz=FuzzLexer -fuzztime=30s ./internal/query
go test -fuzz=FuzzLWWRegisterMerge -fuzztime=30s ./internal/crdt
go test -fuzz=FuzzHashData -fuzztime=30s ./internal/sync
go test -fuzz=FuzzWAL -fuzztime=30s ./internal/storage
# Crypto has multiple fuzz tests - run each one
go test -fuzz=FuzzSealOpen -fuzztime=10s ./internal/crypto
go test -fuzz=FuzzECDH -fuzztime=10s ./internal/crypto
go test -fuzz=FuzzEnvelope -fuzztime=10s ./internal/crypto
go test -fuzz=FuzzSignVerify -fuzztime=10s ./internal/crypto
go test -fuzz=FuzzDeriveKey -fuzztime=10s ./internal/crypto
- name: Upload fuzz corpora
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-corpora-short
path: '**/testdata/fuzz/**'
retention-days: 7
fuzz-long:
name: Fuzz (5min)
runs-on: ubuntu-latest
timeout-minutes: 30
# Only run long fuzz on schedule or manual dispatch
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
- name: Run fuzz tests (long)
run: |
go test -fuzz=FuzzCodec -fuzztime=5m ./internal/encoding
go test -fuzz=FuzzLexer -fuzztime=5m ./internal/query
go test -fuzz=FuzzLWWRegisterMerge -fuzztime=5m ./internal/crdt
go test -fuzz=FuzzHashData -fuzztime=5m ./internal/sync
go test -fuzz=FuzzWAL -fuzztime=5m ./internal/storage
# Crypto has multiple fuzz tests
go test -fuzz=FuzzSealOpen -fuzztime=2m ./internal/crypto
go test -fuzz=FuzzECDH -fuzztime=2m ./internal/crypto
go test -fuzz=FuzzEnvelope -fuzztime=2m ./internal/crypto
go test -fuzz=FuzzSignVerify -fuzztime=2m ./internal/crypto
go test -fuzz=FuzzDeriveKey -fuzztime=2m ./internal/crypto
- name: Upload fuzz corpora
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-corpora-long
path: '**/testdata/fuzz/**'
retention-days: 30