From 75f68655efa259f5600692a6cb0eceea4983948d Mon Sep 17 00:00:00 2001 From: stroblme Date: Sun, 16 Aug 2026 16:46:25 +0200 Subject: [PATCH] Point the backend suite at the db container while the stack is up The integrated stack drops every published host port, so make test-backend could not reach Postgres on localhost:5432 whenever the stack it shares a machine with was running. It now asks Docker where the container is; with the stack down, .env still stands. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01H7LwYgJfpkbLCTeiAf8U4A --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d25f4fe..6b0b2ed 100644 --- a/Makefile +++ b/Makefile @@ -69,8 +69,13 @@ generate-client: ## Regenerate the frontend SDK from the backend's OpenAPI sche test: test-backend test-frontend ## Run all tests (backend + frontend) +# The integrated stack publishes no host port for Postgres (docker/compose.local.yml +# drops them all), so the suite reaches the container on the compose network +# instead. Empty when the stack is down — then .env's localhost:5432 stands. +DB_HOST = $(shell docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}' fluksio-db 2>/dev/null | awk '{print $$1}') + test-backend: ## Run backend tests (pytest + coverage) - cd backend && uv run bash scripts/tests-start.sh + cd backend && $(if $(DB_HOST),POSTGRES_SERVER=$(DB_HOST)) uv run bash scripts/tests-start.sh test-frontend: ## Run frontend tests (Playwright e2e) cd frontend && bunx playwright test