Skip to content

Commit

Permalink
chore: add ci cfg for fuzz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Mar 6, 2024
1 parent 5049a86 commit 1488e58
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/actions/fuzz-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Fuzz Test
description: 'Fuzz test given setup and service'
inputs:
target:
description: "The fuzz target to test"

runs:
using: "composite"
steps:
- name: Setup Fuzz Test
shell: bash
run: |
mkdir -p ./dynamic_fuzz_test &&
cat <<EOF >./dynamic_fuzz_test/action.yml
runs:
using: composite
steps:
- name: Run Fuzz Test
shell: bash
run: cargo +nightly fuzz run ${{ inputs.target }} --fuzz-dir tests-fuzz -- -max_total_time=120
env:
GT_MYSQL_ADDR: 127.0.0.1:4002
EOF
- name: Run
uses: ./dynamic_fuzz_test
32 changes: 32 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,38 @@ jobs:
artifacts-dir: bins
version: current

fuzztest:
name: Fuzz Test
needs: build
runs-on: ubuntu-20.04
strategy:
matrix:
target: [ "fuzz_create_table" ]
steps:
- uses: actions/checkout@v4
- name: Set Rust Fuzz
shell: bash
run: |
sudo apt update && sudo apt install -y libfuzzer-14-dev
rustup install nightly
cargo +nightly install cargo-fuzz
- name: Download pre-built binaries
uses: actions/download-artifact@v4
with:
name: bins
path: .
- name: Unzip binaries
run: tar -xvf ./bins.tar.gz
- name: Run GreptimeDB
run: |
./bins/greptime standalone start&
- name: Fuzz Test
uses: ./.github/actions/fuzz-test
env:
CUSTOM_LIBFUZZER_PATH: /usr/lib/llvm-14/lib/libFuzzer.a
with:
target: ${{ matrix.target }}

sqlness:
name: Sqlness Test
needs: build
Expand Down

0 comments on commit 1488e58

Please sign in to comment.