Fix Integration Tests: Dependencies, Config und Bugs

- test.sh: .venv Support und verbesserte API Key Erkennung
- test_integration.py: Cleanup Logik repariert (Duplicate Token)
- docker-compose.yml: Port 3306 für lokale Tests exposed
- rag_service.py: NameError und Collection Naming Bug gefixt
This commit is contained in:
2025-12-07 20:31:05 +01:00
parent 41f363eb27
commit 0e7865ee57
4 changed files with 49 additions and 7 deletions

View File

@@ -58,6 +58,15 @@ def cleanup_test_data(conn, child_id=None):
else:
# Clean up all test data
cur.execute("DELETE FROM post_vectors WHERE post_type='diary'")
# Clean up specific test user by token (in case ID < 9000)
cur.execute("SELECT id FROM children WHERE token = 'test-token-12345'")
result = cur.fetchone()
if result:
cur.execute("DELETE FROM diary_entries WHERE child_id = %s", (result['id'],))
cur.execute("DELETE FROM children WHERE id = %s", (result['id'],))
# Legacy cleanup
cur.execute("DELETE FROM diary_entries WHERE child_id >= 9000")
cur.execute("DELETE FROM children WHERE id >= 9000")
conn.commit()