Skip to content

Add fuzz tests for ParseXXX and token.QuoteXXX functions - #415

Open
makenowjust wants to merge 2 commits into
cloudspannerecosystem:mainfrom
makenowjust:MakeNowJust/fuzz
Open

Add fuzz tests for ParseXXX and token.QuoteXXX functions#415
makenowjust wants to merge 2 commits into
cloudspannerecosystem:mainfrom
makenowjust:MakeNowJust/fuzz

Conversation

@makenowjust

@makenowjust makenowjust commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

This PR adds go test -fuzz for memefish's public API.

Targets

  • fuzz_test.go
    • FuzzParseStatements, FuzzParseQuery, FuzzParseExpr, FuzzParseType, FuzzParseSchemaType, FuzzParseGQLGraphPattern
    • FuzzSplitRawStatements
  • token/fuzz_test.go:
    • FuzzQuoteSQLString, FuzzQuoteSQLBytes, FuzzQuoteSQLIdent

Seeds come from testdata/input/*.

CI

This PR adds .github/workflows/fuzz.yml, which runs every target for 2 minutes on a weekly schedule (plus workflow_dispatch for manual runs) and uploads any failing inputs as artifacts.

Findings

Short local runs (30s per target) already found three bugs, filed separately:

The fuzzer-generated crash reproducers are committed under testdata/fuzz/<FuzzTarget>/, so this PR's CI stays failed until the three fix PRs above are merged.

How to run

$ go test -fuzz='^FuzzParseStatements$' -fuzztime=5m .
$ go test -fuzz='^FuzzQuoteSQLString$' -fuzztime=5m ./token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant