Skip to content

Commit

Permalink
Merge pull request #13 from Tmonster/fix_fuzzer_script
Browse files Browse the repository at this point in the history
remove argument from fuzzing script
  • Loading branch information
Tmonster authored Jul 12, 2024
2 parents a7d940f + 6770e86 commit 9a249fa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/test-fuzzer-ci-still-works.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: test-fuzzer-ci-still-works
on:
workflow_dispatch:
repository_dispatch:
pull_request:
push:
branches:
- '**'
Expand Down Expand Up @@ -29,12 +29,30 @@ jobs:
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build ccache

- name: checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: duckdb/duckdb
fetch-depth: 0

- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main

- id: find-hash
run: echo "::set-output name=hash::$(git rev-parse HEAD)"

- name: create build sqlsmith extension file
shell: bash
run: |
echo "duckdb_extension_load(sqlsmith
GIT_URL https://github.com/duckdb/duckdb_sqlsmith
GIT_TAG main
)" > sqlsmith.cmake
- name: Build
shell: bash
run: |
EXTENSION_CONFIGS="sqlsmith.cmake" make debug
- uses: actions/upload-artifact@v3
with:
name: duckdb
Expand All @@ -45,7 +63,7 @@ jobs:
needs:
- build-duckdb
runs-on: ubuntu-latest
timeout-minutes: 120
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -55,7 +73,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
repository: duckdb/duckdb_sqlsmith
path: duckdb_sqlsmith
fetch-depth: 0

- name: Download a single artifact
Expand All @@ -70,9 +88,10 @@ jobs:
runtime="1 minute"
endtime=$(date -ud "$runtime" +%s)
cd duckdb_sqlsmith
while [[ $(date -u +%s) -le $endtime ]]
do
echo "Time Now: `date +%H:%M:%S`"
python3 scripts/run_fuzzer.py --no_checks --${{ matrix.fuzzer }} --${{ matrix.data }} --shell=./duckdb --dry
python3 scripts/run_fuzzer.py --no_checks --${{ matrix.fuzzer }} --${{ matrix.data }} --shell=../duckdb --dry --max_queries=10
done
7 changes: 5 additions & 2 deletions scripts/run_fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
shell = None
perform_checks = True
dry = False
max_queries = 1000
for param in sys.argv:
if param == '--sqlsmith':
fuzzer = 'sqlsmith'
Expand All @@ -33,6 +34,8 @@
shell = param.replace('--shell=', '')
elif param.startswith('--seed='):
seed = int(param.replace('--seed=', ''))
elif param.startswith('--max_queries='):
max_queries = int(param.replace('--max_queries=', ''))
elif param.startswith('--dry'):
dry = True

Expand Down Expand Up @@ -102,7 +105,7 @@ def run_shell_command(cmd):
else:
current_errors = fuzzer_helper.extract_github_issues(shell, perform_checks)

max_queries = 1000

last_query_log_file = 'sqlsmith.log'
complete_log_file = 'sqlsmith.complete.log'

Expand Down Expand Up @@ -157,7 +160,7 @@ def run_shell_command(cmd):
with open(complete_log_file, 'r') as f:
all_queries = f.read()

(stdout, stderr, returncode) = run_shell_command(load_script + '\n' + all_queries, True)
(stdout, stderr, returncode) = run_shell_command(load_script + '\n' + all_queries)
if returncode == 0:
print("Failed to reproduce the issue...")
exit(0)
Expand Down

0 comments on commit 9a249fa

Please sign in to comment.