Skip to content

Instantly share code, notes, and snippets.

@findepi
Last active May 21, 2025 12:45
Show Gist options
  • Save findepi/fcafdbd5498e00bbfab75a8e8972423a to your computer and use it in GitHub Desktop.
Save findepi/fcafdbd5498e00bbfab75a8e8972423a to your computer and use it in GitHub Desktop.

quick build

cargo build

full build

cargo build --all

all code checks

# check compilation
cargo build --all-targets &&

# fmt, clippy, taplo, doc
dev/rust_lint.sh && 

echo all checks OK

all tests

# doc tests
cargo test --doc --features avro,json
( cd datafusion-cli && cargo test --doc --all-features ) &&

# tests
( ulimit -n 2048 && RUST_BACKTRACE=1 cargo test --lib --tests --bins --features avro,json,backtrace ) &&
( cd datafusion-cli && cargo test --lib --tests --bins --all-features ) &&

echo all tests OK

plan tests

cargo test --test sqllogictests

PostgreSQL CLI for cross-checking behavior

(
  set +e -u
  container="tmp-postgres"
  docker rm -f "${container}"
  docker run -d --name "${container}" -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 postgres:17 &&
  # TODO wait for startup
  sleep 5s &&
  docker exec -it "${container}" psql -U postgres -d postgres
  docker rm -f "${container}"
)

Trino CLI for cross-checking behavior

(
  set +e -u
  container="tmp-trino"
  docker rm -f "${container}"
  docker run -d --name "${container}" -d trinodb/trino:475 &&
  until [ "$(docker inspect -f '{{.State.Health.Status}}' "${container}" )" == "healthy" ]; do
    sleep 0.1;
  done &&
  docker exec -it "${container}" trino
  docker rm -f tmp-trino
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment