Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ risedev-components.user.env
risedev-compose.yml
risedev-profiles.user.yml
ft.txt
.sqlsmith/
# generated output from regress tests
src/tests/regress/output/*
src/tests/sync_point/slt/e2e_test
Expand Down
58 changes: 58 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1484,3 +1484,61 @@ echo "Node ${NODE_NAME} restarted."
category = "RiseDev - Benchmark"
description = "Run a local or remote sql benchmark on a RisingWave instance"
script = "./develop/sql_bench/main.py $@"

[tasks.build-sqlsmith-reducer]
category = "RiseDev - Build"
description = "Build Sqlsmith Reducer"
condition = { env_true = ["ENABLE_BUILD_RUST"] }
script = '''
#!/usr/bin/env bash

set -e

[[ -z "${RISEDEV_RUSTFLAGS}" ]] || export RUSTFLAGS="${RISEDEV_RUSTFLAGS}"
echo + RUSTFLAGS="${RUSTFLAGS:-<not set>}"
echo + cargo build -p risedev
cargo build -p risedev

set -xe
cargo build --bin sqlsmith-reducer \
--profile "${RISINGWAVE_BUILD_PROFILE}" \
${RISINGWAVE_FEATURE_FLAGS} \
${RISEDEV_CARGO_BUILD_EXTRA_ARGS}
'''

[tasks.sr]
alias = "sql-reduce-short"

[tasks.sql-reduce-short]
category = "RiseDev - Reduce"
description = "Reduce a failing SQL query while preserving error"
dependencies = ["pre-start-dev", "build-sqlsmith-reducer"]
script = '''
#!/usr/bin/env bash
INPUT_FILE="$1"
OUTPUT_FILE=".sqlsmith/reduced.sql"
LOG_FILE=".sqlsmith/sqlsmith.log"

if [[ -z "${INPUT_FILE:-}" ]]; then
echo "Please pass in the query file path for shrinking."
exit 1
fi

mkdir -p '.sqlsmith'
echo "Shrinking: $INPUT_FILE"

RUST_LOG=info target/${RISEDEV_BUILD_TARGET_DIR}${BUILD_MODE_DIR}/sqlsmith-reducer --input-file "$INPUT_FILE" --output-file "$OUTPUT_FILE" --run-rw-cmd "./risedev k && ./risedev d" 1>"$LOG_FILE" 2>&1

echo "Shrunk file: $OUTPUT_FILE"
echo "Log file: $LOG_FILE"
'''

[tasks.sql-reduce-full]
category = "RiseDev - Reduce"
description = "Reduce a failing SQL query while preserving error"
dependencies = ["pre-start-dev", "build-sqlsmith-reducer"]
script = '''
#!/usr/bin/env bash

target/${RISEDEV_BUILD_TARGET_DIR}${BUILD_MODE_DIR}/sqlsmith-reducer "$@"
'''
Loading