.PHONY: up down logs check test test-seq load fresh

# Bring the stack up and wait for every health check to pass. Tests that start
# before Postgres is ready fail in a way that looks like a code bug.
up:
	docker compose up -d --wait

down:
	docker compose down -v

logs:
	docker compose logs -f

check:
	uv run ruff check .
	uv run mypy src

# Randomised order is the default: fixture leakage passes sequentially and
# fails at random, so the suite has to prove it is order-independent.
test: up
	uv run pytest tests/integrations

# Sequential, for reproducing a specific failure.
test-seq: up
	uv run pytest tests/integrations -p no:randomly

load: up
	k6 run tests/load/spec_tier.js
	k6 run tests/load/order_and_poll.js

fresh: down up
