-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_startup.py
More file actions
52 lines (43 loc) · 1.59 KB
/
test_startup.py
File metadata and controls
52 lines (43 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
Test application startup
"""
import sys
import os
import asyncio
# Add the root directory to Python path
root_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, root_dir)
async def test_startup():
"""Test the application startup sequence"""
try:
print("Testing application startup...")
# Test database initialization
print("1. Testing database initialization...")
from src.database.connection import init_database
await init_database()
print("[OK] Database initialized")
# Test LangGraph integration
print("2. Testing LangGraph integration...")
from src.core.langgraph_integration import get_langgraph_integration
integration = await get_langgraph_integration()
print("[OK] LangGraph integration initialized")
# Test health check
print("3. Testing health check...")
health = await integration.health_check()
print(f"[OK] Health status: {health['status']}")
# Test cleanup
print("4. Testing cleanup...")
from src.core.langgraph_integration import cleanup_langgraph_integration
await cleanup_langgraph_integration()
print("[OK] Cleanup completed")
print("\n[SUCCESS] All startup tests passed!")
return True
except Exception as e:
print(f"[ERROR] Startup test failed: {e}")
import traceback
traceback.print_exc()
return False
if __name__ == "__main__":
success = asyncio.run(test_startup())
if not success:
sys.exit(1)