File size: 2,069 Bytes
7644eac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Test script to verify all imports work correctly
Run this before deploying to catch any import errors
"""
import sys
from pathlib import Path

# Add project root to path
PROJECT_ROOT = Path(__file__).parent
sys.path.insert(0, str(PROJECT_ROOT))

print("=" * 60)
print("Testing Imports for Hybrid Architecture")
print("=" * 60)

errors = []

# Test backend imports
print("\nπŸ“¦ Testing Backend Imports...")
try:
    from backend import app
    print("βœ… backend.app")
except Exception as e:
    print(f"❌ backend.app: {e}")
    errors.append(("backend.app", e))

try:
    from backend import routes
    print("βœ… backend.routes")
except Exception as e:
    print(f"❌ backend.routes: {e}")
    errors.append(("backend.routes", e))

# Test worker imports
print("\nβš™οΈ Testing Worker Imports...")
try:
    from worker import celery_app
    print("βœ… worker.celery_app")
except Exception as e:
    print(f"❌ worker.celery_app: {e}")
    errors.append(("worker.celery_app", e))

try:
    from worker import tasks
    print("βœ… worker.tasks")
except Exception as e:
    print(f"❌ worker.tasks: {e}")
    errors.append(("worker.tasks", e))

# Test existing src imports
print("\nπŸ”§ Testing Existing Src Imports...")
try:
    from src.learning_path import LearningPathGenerator
    print("βœ… src.learning_path.LearningPathGenerator")
except Exception as e:
    print(f"❌ src.learning_path.LearningPathGenerator: {e}")
    errors.append(("src.learning_path", e))

try:
    from src.ml.model_orchestrator import ModelOrchestrator
    print("βœ… src.ml.model_orchestrator.ModelOrchestrator")
except Exception as e:
    print(f"❌ src.ml.model_orchestrator: {e}")
    errors.append(("src.ml.model_orchestrator", e))

# Summary
print("\n" + "=" * 60)
if not errors:
    print("πŸŽ‰ All imports successful!")
    print("\nβœ… Ready for deployment!")
else:
    print(f"⚠️  {len(errors)} import error(s) found:")
    for module, error in errors:
        print(f"   - {module}: {error}")
    print("\n❌ Fix these errors before deploying")

print("=" * 60)