Skip to content

Commit

Permalink
adds oss-fuzz CI and a parser test
Browse files Browse the repository at this point in the history
  • Loading branch information
vroldanbet committed Sep 20, 2022
1 parent ca7754e commit 5d6fbd2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/fuzzing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Fuzzing Testing"
on: # yamllint disable-line rule:truthy
push:
branches:
- "!dependabot/*"
- "main"
pull_request:
branches: ["*"]
jobs:
fuzz:
runs-on: "ubuntu-latest"
steps:
- name: "Build Fuzzers"
id: "build"
uses: "google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master"
with:
oss-fuzz-project-name: "spicedb"
language: "go"
dry-run: "false"
- name: "Run Fuzzers"
uses: "google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master"
with:
oss-fuzz-project-name: "spicedb"
language: "go"
fuzz-seconds: 300
dry-run: false
- name: "Upload Crash"
uses: "actions/upload-artifact@v3"
if: failure() && steps.build.outcome == 'success'
with:
name: "artifacts"
path: "./out/artifacts"
13 changes: 13 additions & 0 deletions pkg/schemadsl/parser/fuzz_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package parser

import (
"testing"

"github.com/authzed/spicedb/pkg/schemadsl/input"
)

func FuzzParser(f *testing.F) {
f.Fuzz(func(t *testing.T, v string) {
_ = Parse(createAstNode, input.Source(v), v)
})
}

0 comments on commit 5d6fbd2

Please sign in to comment.