working
This commit is contained in:
parent
c0999370c6
commit
4e1a339432
17 changed files with 393 additions and 91 deletions
35
Makefile
35
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
.PHONY: install-backend install-frontend install setup-hooks backend frontend worker db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck generate-types generate-types-standalone check-types-fresh check-constants lint-backend format-backend fix-backend security-backend lint-frontend fix-frontend format-frontend pre-commit lint
|
||||
.PHONY: install-backend install-frontend install setup-hooks backend frontend worker db db-stop db-ready db-ready-backend-tests db-ready-e2e-tests db-seed dev test test-backend test-frontend test-e2e typecheck generate-types generate-types-standalone check-types-fresh check-constants lint-backend format-backend fix-backend security-backend lint-frontend fix-frontend format-frontend pre-commit lint
|
||||
|
||||
-include .env
|
||||
export
|
||||
|
|
@ -40,17 +40,27 @@ db-ready:
|
|||
done
|
||||
@docker compose exec -T db psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'arbret'" | grep -q 1 || \
|
||||
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret"
|
||||
@echo "PostgreSQL is ready"
|
||||
|
||||
# Create worker-specific databases for parallel backend test execution (pytest-xdist)
|
||||
db-ready-backend-tests: db-ready
|
||||
@echo "Creating backend test databases..."
|
||||
@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"
|
||||
@# Create worker-specific databases for parallel backend test execution (pytest-xdist)
|
||||
@for i in 0 1 2 3 4 5 6 7; do \
|
||||
docker compose exec -T db psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'arbret_test_gw$$i'" | grep -q 1 || \
|
||||
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_test_gw$$i"; \
|
||||
done
|
||||
@# Create separate database for e2e tests
|
||||
@docker compose exec -T db psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'arbret_e2e'" | grep -q 1 || \
|
||||
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_e2e"
|
||||
@echo "PostgreSQL is ready"
|
||||
@echo "Backend test databases ready"
|
||||
|
||||
# Create worker-specific databases for parallel e2e test execution
|
||||
db-ready-e2e-tests: db-ready
|
||||
@echo "Creating e2e test databases..."
|
||||
@for i in 0 1 2 3 4 5 6 7; do \
|
||||
docker compose exec -T db psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'arbret_e2e_worker$$i'" | grep -q 1 || \
|
||||
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_e2e_worker$$i"; \
|
||||
done
|
||||
@echo "E2E test databases ready"
|
||||
|
||||
db-seed: db-ready
|
||||
cd backend && uv run python seed.py
|
||||
|
|
@ -68,7 +78,7 @@ dev:
|
|||
# E2E: TEST="auth" (file pattern matching e2e/*.spec.ts)
|
||||
TEST ?=
|
||||
|
||||
test-backend: db-ready test-backend-clean-dbs
|
||||
test-backend: db-ready-backend-tests test-backend-clean-dbs
|
||||
cd backend && uv run pytest -v -n 8 $(TEST)
|
||||
|
||||
# Clean only backend test databases (not e2e or main db)
|
||||
|
|
@ -81,13 +91,16 @@ test-backend-clean-dbs:
|
|||
test-frontend:
|
||||
cd frontend && npm run test $(if $(TEST),-- $(TEST),)
|
||||
|
||||
test-e2e: db-ready test-e2e-clean-db
|
||||
test-e2e: db-ready-e2e-tests test-e2e-clean-db
|
||||
./scripts/e2e.sh $(TEST)
|
||||
|
||||
# Clean only e2e database (not backend test dbs or main db)
|
||||
# Clean only e2e databases (not backend test dbs or main db)
|
||||
# Create worker-specific databases for parallel e2e test execution
|
||||
test-e2e-clean-db:
|
||||
@docker compose exec -T db psql -U postgres -c "DROP DATABASE IF EXISTS arbret_e2e" 2>/dev/null || true
|
||||
@docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_e2e"
|
||||
@for i in 0 1 2 3 4 5 6 7; do \
|
||||
docker compose exec -T db psql -U postgres -c "DROP DATABASE IF EXISTS arbret_e2e_worker$$i" 2>/dev/null || true; \
|
||||
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_e2e_worker$$i" 2>/dev/null || true; \
|
||||
done
|
||||
|
||||
test: check-constants check-types-fresh test-backend test-frontend test-e2e
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue