tests passing
This commit is contained in:
parent
0995e1cc77
commit
7ebfb7a2dd
20 changed files with 2009 additions and 126 deletions
15
Makefile
15
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
.PHONY: install-backend install-frontend install backend frontend db db-stop dev test test-frontend test-e2e
|
||||
.PHONY: install-backend install-frontend install backend frontend db db-stop db-ready dev test test-backend test-frontend test-e2e
|
||||
|
||||
install-backend:
|
||||
cd backend && uv sync --all-groups
|
||||
|
|
@ -20,13 +20,23 @@ db:
|
|||
db-stop:
|
||||
docker compose down
|
||||
|
||||
db-ready:
|
||||
@docker compose up -d db
|
||||
@echo "Waiting for PostgreSQL to be ready..."
|
||||
@until docker compose exec -T db pg_isready -U postgres > /dev/null 2>&1; do \
|
||||
sleep 1; \
|
||||
done
|
||||
@docker compose exec -T db psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'arbret_test'" | grep -q 1 || \
|
||||
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_test"
|
||||
@echo "PostgreSQL is ready"
|
||||
|
||||
dev:
|
||||
$(MAKE) db
|
||||
cd backend && uv run uvicorn main:app --reload & \
|
||||
cd frontend && npm run dev & \
|
||||
wait
|
||||
|
||||
test-backend:
|
||||
test-backend: db-ready
|
||||
cd backend && uv run pytest -v
|
||||
|
||||
test-frontend:
|
||||
|
|
@ -35,3 +45,4 @@ test-frontend:
|
|||
test-e2e:
|
||||
./scripts/e2e.sh
|
||||
|
||||
test: test-backend test-frontend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue