Split justfiles
This commit is contained in:
parent
c2c1d1c8ed
commit
4e34c8d81b
4 changed files with 71 additions and 51 deletions
50
backend/justfile
Normal file
50
backend/justfile
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# Backend development commands for Captain's Log
|
||||
|
||||
export DATABASE_URL :="sqlite://local.db"
|
||||
|
||||
dev-backend:
|
||||
cargo run
|
||||
|
||||
build-backend:
|
||||
cargo build
|
||||
|
||||
test-unit-backend:
|
||||
cargo test
|
||||
|
||||
fmt-backend:
|
||||
cargo fmt --check
|
||||
|
||||
lint-backend:
|
||||
cargo clippy
|
||||
|
||||
clean-backend:
|
||||
cargo clean
|
||||
|
||||
reset-db:
|
||||
sqlx database drop
|
||||
sqlx database create
|
||||
sqlx migrate run
|
||||
|
||||
migrate:
|
||||
sqlx migrate run
|
||||
|
||||
migrate-revert:
|
||||
sqlx migrate revert
|
||||
|
||||
test-integration:
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
cargo run &
|
||||
SERVER_PID=$!
|
||||
|
||||
trap 'echo "Stopping server..."; kill -TERM $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true' EXIT
|
||||
|
||||
echo "Waiting for server to start..."
|
||||
printf 'GET http://localhost:3000/health\nHTTP 200' | hurl --retry 30 > /dev/null
|
||||
|
||||
echo "Running integration tests..."
|
||||
hurl --test --error-format long --variable host=http://localhost:3000 tests/api/*.hurl
|
||||
|
||||
test-coverage:
|
||||
cargo tarpaulin --out Html --output-dir coverage
|
||||
Loading…
Add table
Add a link
Reference in a new issue