yugbirla commited on
Commit
0df003e
·
1 Parent(s): b0aa836

Add final smoke test and testing checklist

Browse files
FINAL_TEST_CHECKLIST.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Final Testing Checklist - GraphResearcher
2
+
3
+ Use this checklist after deployment.
4
+
5
+ ## Basic pages
6
+ - [ ] Open `/`
7
+ - [ ] Open `/app`
8
+ - [ ] Open `/login`
9
+ - [ ] Open `/admin`
10
+
11
+ ## Single document flow
12
+ - [ ] Clear Workspace Cache
13
+ - [ ] Upload one PDF
14
+ - [ ] Confirm document appears in left sidebar
15
+ - [ ] Ask a simple question
16
+ - [ ] Ask a detailed question
17
+ - [ ] Check answer renders properly
18
+ - [ ] Check sources appear on right side
19
+ - [ ] Click Open source
20
+ - [ ] Click Build / Rebuild Graph
21
+ - [ ] Click View Graph
22
+
23
+ ## Compare flow
24
+ - [ ] Upload second PDF
25
+ - [ ] Select first document
26
+ - [ ] Choose second document in Compare With
27
+ - [ ] Ask a comparison question
28
+ - [ ] Confirm side-by-side answer appears
29
+ - [ ] Confirm sources for both documents appear
30
+
31
+ ## Delete flow
32
+ - [ ] Delete selected document
33
+ - [ ] Confirm it disappears from sidebar
34
+ - [ ] Open `/documents/<DOCUMENT_ID>/storage`
35
+ - [ ] Confirm backend storage is missing/deleted or delete attempted
36
+
37
+ ## Final notes
38
+ - Files on Hugging Face `/tmp` are temporary.
39
+ - If old documents show after rebuild, clear workspace cache and re-upload.
40
+ - Do not expose API Docs or GraphRAG Console in normal user UI.
scripts/phase39_final_smoke_test.py ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ import py_compile
3
+ import traceback
4
+
5
+ print("\n==============================")
6
+ print("PHASE 39 FINAL SMOKE TEST")
7
+ print("==============================\n")
8
+
9
+ files_to_compile = [
10
+ "app/main.py",
11
+ "app/deployment/hf_status.py",
12
+ "app/product/final_product_ui.py",
13
+ "app/product/document_storage_manager.py",
14
+ "app/product/document_compare_service.py",
15
+ "app/product/source_viewer.py",
16
+ "app/product/admin_ui.py",
17
+ "app/product/auth_service.py",
18
+ ]
19
+
20
+ compile_failed = False
21
+
22
+ print("1. Checking Python compile...\n")
23
+
24
+ for file in files_to_compile:
25
+ path = Path(file)
26
+
27
+ if not path.exists():
28
+ print(f"SKIP missing: {file}")
29
+ continue
30
+
31
+ try:
32
+ py_compile.compile(str(path), doraise=True)
33
+ print(f"OK: {file}")
34
+ except Exception:
35
+ compile_failed = True
36
+ print(f"FAILED: {file}")
37
+ traceback.print_exc()
38
+
39
+ print("\n2. Checking FastAPI app import and routes...\n")
40
+
41
+ required_routes = [
42
+ ("/", "GET"),
43
+ ("/app", "GET"),
44
+ ("/ask", "POST"),
45
+ ("/documents/upload", "POST"),
46
+ ("/documents/{document_id}/graph/build", "POST"),
47
+ ("/documents/{document_id}/graph/view", "GET"),
48
+ ("/documents/{document_id}/sources/{source_id}/view", "GET"),
49
+ ("/documents/{document_id}/storage", "GET"),
50
+ ("/documents/{document_id}/delete", "DELETE"),
51
+ ("/documents/compare", "POST"),
52
+ ("/login", "GET"),
53
+ ("/admin", "GET"),
54
+ ]
55
+
56
+ try:
57
+ from app.main import app
58
+
59
+ existing = set()
60
+
61
+ for route in app.routes:
62
+ path = getattr(route, "path", "")
63
+ methods = getattr(route, "methods", set()) or set()
64
+
65
+ for method in methods:
66
+ existing.add((path, method))
67
+
68
+ missing = []
69
+
70
+ for route in required_routes:
71
+ if route in existing:
72
+ print(f"OK route: {route[1]} {route[0]}")
73
+ else:
74
+ print(f"MISSING route: {route[1]} {route[0]}")
75
+ missing.append(route)
76
+
77
+ print("\n3. Summary\n")
78
+
79
+ if compile_failed:
80
+ print("RESULT: FAILED - compile errors exist.")
81
+ elif missing:
82
+ print("RESULT: PARTIAL - app imports, but some expected routes are missing.")
83
+ print("Missing routes:")
84
+ for method_path in missing:
85
+ print(f"- {method_path[1]} {method_path[0]}")
86
+ else:
87
+ print("RESULT: PASS - core app files compile and required routes exist.")
88
+
89
+ except Exception:
90
+ print("RESULT: FAILED - app.main could not be imported.")
91
+ traceback.print_exc()
92
+
93
+
94
+ checklist = """# Final Testing Checklist - GraphResearcher
95
+
96
+ Use this checklist after deployment.
97
+
98
+ ## Basic pages
99
+ - [ ] Open `/`
100
+ - [ ] Open `/app`
101
+ - [ ] Open `/login`
102
+ - [ ] Open `/admin`
103
+
104
+ ## Single document flow
105
+ - [ ] Clear Workspace Cache
106
+ - [ ] Upload one PDF
107
+ - [ ] Confirm document appears in left sidebar
108
+ - [ ] Ask a simple question
109
+ - [ ] Ask a detailed question
110
+ - [ ] Check answer renders properly
111
+ - [ ] Check sources appear on right side
112
+ - [ ] Click Open source
113
+ - [ ] Click Build / Rebuild Graph
114
+ - [ ] Click View Graph
115
+
116
+ ## Compare flow
117
+ - [ ] Upload second PDF
118
+ - [ ] Select first document
119
+ - [ ] Choose second document in Compare With
120
+ - [ ] Ask a comparison question
121
+ - [ ] Confirm side-by-side answer appears
122
+ - [ ] Confirm sources for both documents appear
123
+
124
+ ## Delete flow
125
+ - [ ] Delete selected document
126
+ - [ ] Confirm it disappears from sidebar
127
+ - [ ] Open `/documents/<DOCUMENT_ID>/storage`
128
+ - [ ] Confirm backend storage is missing/deleted or delete attempted
129
+
130
+ ## Final notes
131
+ - Files on Hugging Face `/tmp` are temporary.
132
+ - If old documents show after rebuild, clear workspace cache and re-upload.
133
+ - Do not expose API Docs or GraphRAG Console in normal user UI.
134
+ """
135
+
136
+ Path("FINAL_TEST_CHECKLIST.md").write_text(checklist, encoding="utf-8")
137
+ print("\nCreated FINAL_TEST_CHECKLIST.md")