feat: complete ANL lab web application with lossless data migration and SSG routes
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
CONTENT_DIR = os.path.join(BASE_DIR, "refer_landing_page", "content")
|
||||
|
||||
sys.path.insert(0, os.path.join(BASE_DIR, "refer_landing_page", "scripts", "extract"))
|
||||
|
||||
def verify():
|
||||
# Import generated modules or json
|
||||
from generate_all import parse_members, parse_publications, parse_lectures, parse_standards
|
||||
|
||||
active_m, alumni_m = parse_members()
|
||||
intl_p, dom_p, pat_p = parse_publications()
|
||||
semesters = parse_lectures()
|
||||
bodies = parse_standards()
|
||||
|
||||
total_pubs = len(intl_p) + len(dom_p) + len(pat_p)
|
||||
std_docs_count = sum(len(p["documents"]) for b in bodies for p in b["projects"])
|
||||
|
||||
print("=== DATA VERIFICATION GATE (AC-07 / AC-08) ===")
|
||||
print(f"Active Members: {len(active_m)} (Expected: 16)")
|
||||
print(f"Alumni: {len(alumni_m)} (Expected: 60)")
|
||||
print(f"International Papers: {len(intl_p)} (Expected: 68)")
|
||||
print(f"Domestic Papers: {len(dom_p)} (Expected: 80)")
|
||||
print(f"Patents: {len(pat_p)} (Expected: 75)")
|
||||
print(f"Total Publications: {total_pubs} (Expected: 223)")
|
||||
print(f"Standard Bodies: {len(bodies)} (Expected: 6)")
|
||||
print(f"Standard Documents: {std_docs_count} (Expected: ~55)")
|
||||
|
||||
errors = []
|
||||
if len(active_m) != 16:
|
||||
errors.append(f"Active Members count mismatch: got {len(active_m)}, expected 16")
|
||||
if len(alumni_m) != 60:
|
||||
errors.append(f"Alumni count mismatch: got {len(alumni_m)}, expected 60")
|
||||
if len(intl_p) != 68:
|
||||
errors.append(f"International Papers count mismatch: got {len(intl_p)}, expected 68")
|
||||
if len(dom_p) != 80:
|
||||
errors.append(f"Domestic Papers count mismatch: got {len(dom_p)}, expected 80")
|
||||
if len(pat_p) != 75:
|
||||
errors.append(f"Patents count mismatch: got {len(pat_p)}, expected 75")
|
||||
if total_pubs != 223:
|
||||
errors.append(f"Total Publications count mismatch: got {total_pubs}, expected 223")
|
||||
|
||||
if errors:
|
||||
print("\n❌ VERIFICATION FAILED:")
|
||||
for err in errors:
|
||||
print(f" - {err}")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("\n✅ ALL DATA VERIFICATION GATES PASSED CLEAN (Exit Code 0)")
|
||||
sys.exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
verify()
|
||||
Reference in New Issue
Block a user