fix: use postgres container for psql commands
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

This commit is contained in:
Lars 2026-03-25 09:54:44 +01:00
parent 6f7303c0d5
commit 053a9e18cf

View File

@ -7,45 +7,44 @@ echo "Pipeline-System Backend Tests"
echo "═══════════════════════════════════════════════════════════" echo "═══════════════════════════════════════════════════════════"
echo "" echo ""
# Container Name (from docker-compose.dev-env.yml) # Container Names (from docker-compose.dev-env.yml)
CONTAINER="dev-mitai-api" POSTGRES_CONTAINER="dev-mitai-postgres"
DB_HOST="postgres-dev"
DB_USER="mitai_dev" DB_USER="mitai_dev"
DB_NAME="mitai_dev" DB_NAME="mitai_dev"
echo "Test 1: Migration 019 ausgeführt" echo "Test 1: Migration 019 ausgeführt"
echo "─────────────────────────────────────────────────────────" echo "─────────────────────────────────────────────────────────"
docker exec $CONTAINER psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \ docker exec $POSTGRES_CONTAINER psql -U $DB_USER -d $DB_NAME -c \
"SELECT version, applied_at FROM schema_migrations WHERE version = '019';" "SELECT version, applied_at FROM schema_migrations WHERE version = '019';"
echo "" echo ""
echo "Test 2: Tabelle pipeline_configs existiert" echo "Test 2: Tabelle pipeline_configs existiert"
echo "─────────────────────────────────────────────────────────" echo "─────────────────────────────────────────────────────────"
docker exec $CONTAINER psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \ docker exec $POSTGRES_CONTAINER psql -U $DB_USER -d $DB_NAME -c \
"\d pipeline_configs" | head -40 "\d pipeline_configs" | head -40
echo "" echo ""
echo "Test 3: Seed-Daten (3 Configs erwartet)" echo "Test 3: Seed-Daten (3 Configs erwartet)"
echo "─────────────────────────────────────────────────────────" echo "─────────────────────────────────────────────────────────"
docker exec $CONTAINER psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \ docker exec $POSTGRES_CONTAINER psql -U $DB_USER -d $DB_NAME -c \
"SELECT name, is_default, active, stage2_prompt, stage3_prompt FROM pipeline_configs ORDER BY is_default DESC, name;" "SELECT name, is_default, active, stage2_prompt, stage3_prompt FROM pipeline_configs ORDER BY is_default DESC, name;"
echo "" echo ""
echo "Test 4: ai_prompts erweitert (is_system_default)" echo "Test 4: ai_prompts erweitert (is_system_default)"
echo "─────────────────────────────────────────────────────────" echo "─────────────────────────────────────────────────────────"
docker exec $CONTAINER psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \ docker exec $POSTGRES_CONTAINER psql -U $DB_USER -d $DB_NAME -c \
"SELECT slug, is_system_default, (default_template IS NOT NULL) as has_default FROM ai_prompts WHERE slug LIKE 'pipeline_%' ORDER BY slug;" "SELECT slug, is_system_default, (default_template IS NOT NULL) as has_default FROM ai_prompts WHERE slug LIKE 'pipeline_%' ORDER BY slug;"
echo "" echo ""
echo "Test 5: stage1_prompts Array-Inhalte" echo "Test 5: stage1_prompts Array-Inhalte"
echo "─────────────────────────────────────────────────────────" echo "─────────────────────────────────────────────────────────"
docker exec $CONTAINER psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \ docker exec $POSTGRES_CONTAINER psql -U $DB_USER -d $DB_NAME -c \
"SELECT name, stage1_prompts FROM pipeline_configs WHERE name = 'Alltags-Check';" "SELECT name, stage1_prompts FROM pipeline_configs WHERE name = 'Alltags-Check';"
echo "" echo ""
echo "Test 6: modules JSONB" echo "Test 6: modules JSONB"
echo "─────────────────────────────────────────────────────────" echo "─────────────────────────────────────────────────────────"
docker exec $CONTAINER psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \ docker exec $POSTGRES_CONTAINER psql -U $DB_USER -d $DB_NAME -c \
"SELECT name, jsonb_pretty(modules) as modules FROM pipeline_configs WHERE name = 'Alltags-Check';" "SELECT name, jsonb_pretty(modules) as modules FROM pipeline_configs WHERE name = 'Alltags-Check';"
echo "" echo ""