Files
Xevion 93381ba5cb test(server): gate PostgreSQL tests behind postgres-tests feature
Move testcontainers to optional dependency and create feature flag for database integration tests. Tests without the feature use a dummy pool and skip database operations.
2026-01-07 00:00:29 -06:00

64 lines
1.7 KiB
Makefile

set shell := ["bash", "-c"]
binary_extension := if os() == "windows" { ".exe" } else { "" }
default:
just --list
# Run cargo-vcpkg build for SDL2 dependencies
vcpkg:
cargo vcpkg build
# Run the game, pass args (e.g., `just pacman::run -r` for release)
run *args:
cargo run -p pacman {{args}}
# Run all checks (clippy for desktop + wasm, warns on format) for pacman package
check:
@echo "Checking format..."
@cargo fmt -p pacman -- --check || echo "⚠ Format issues detected (run \`just format\` to fix)"
@echo "Running clippy for desktop target..."
@cargo clippy -p pacman --all-targets --all-features --quiet -- -D warnings
@echo "Running clippy for wasm target..."
@cargo clippy -p pacman --target wasm32-unknown-emscripten --all-targets --all-features --quiet -- -D warnings
@echo "All checks passed!"
# Run tests with nextest for pacman package
test:
cargo nextest run --all --no-fail-fast
# Auto-format code for pacman package
format:
cargo fmt -p pacman
# Fix linting errors & formatting
fix:
cargo fix --workspace --lib --allow-dirty
cargo fmt --all
# Profile using samply
samply:
cargo build --profile profile
samply record ./target/profile/pacman{{binary_extension}}
# Generate baseline LCOV report
coverage:
cargo +nightly llvm-cov \
--lcov \
--remap-path-prefix \
--workspace \
--output-path lcov.info \
--profile coverage \
--no-fail-fast nextest
# Display coverage report
report-coverage: coverage
cargo llvm-cov report --remap-path-prefix
# Open HTML coverage report
html: coverage
cargo llvm-cov report \
--remap-path-prefix \
--html \
--open