Fuehre die Pflicht-Suite gegen eine Wegwerfdatenbank und lege Nutzer als Betreiber an.
Deploy Development / deploy (push) Failing after 40s

Testdaten entstehen nur dort und werden danach entfernt, damit Dev und Produktion sie nicht behalten.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-16 23:09:28 +02:00
1 parent 528fc191e8
commit 4420790707
24 files changed
+1264 -26

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
# Mandatory suite against a throwaway PostgreSQL. Never the dev or prod database.
set -euo pipefail
NAME="tsumugu-pytest-db"
cleanup() {
docker rm -f "$NAME" >/dev/null 2>&1 || true
}
cleanup
trap cleanup EXIT
docker run -d --name "$NAME" \
-e POSTGRES_USER=tsumugu \
-e POSTGRES_PASSWORD=pytest \
-e POSTGRES_DB=postgres \
postgres:16-alpine >/dev/null
ready=0
for _ in $(seq 1 40); do
if docker exec "$NAME" pg_isready -U tsumugu -d postgres >/dev/null 2>&1; then
ready=1
break
fi
sleep 1
done
if [ "$ready" -ne 1 ]; then
echo "Kurzlebiges PostgreSQL ist nicht bereit."
exit 1
fi
docker run --rm --network "container:${NAME}" \
-e TSUMUGU_ENV=development \
-e TSUMUGU_TEST_HOST=127.0.0.1 \
-e TSUMUGU_TEST_PORT=5432 \
-e TSUMUGU_TEST_USER=tsumugu \
-e TSUMUGU_TEST_PASSWORD=pytest \
-e TSUMUGU_TEST_ADMIN_DB=postgres \
-e DB_HOST=127.0.0.1 \
-e DB_PORT=5432 \
-e DB_NAME=tsumugu_pytest \
-e DB_USER=tsumugu \
-e DB_PASSWORD=pytest \
-e ALLOWED_ORIGINS=http://testserver \
-e SEED_DEMO=false \
-v "$(pwd)/backend:/work" \
-w /work \
python:3.12-slim \
bash -c "pip install -q -r requirements-dev.txt && python -m pytest"