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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user