File size: 2,191 Bytes
f28ecd6 2d06408 f28ecd6 f2a9898 f28ecd6 f2a9898 f28ecd6 f2a9898 f28ecd6 f2a9898 f28ecd6 | 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 | import os
import sys
import subprocess
import time
# Ensure project root is on sys.path
tools_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(tools_dir)
if project_dir not in sys.path:
sys.path.insert(0, project_dir)
def run_test_script(script_name):
script_path = os.path.join(tools_dir, script_name)
print(f"\n==================================================")
print(f" RUNNING VERIFICATION SUITE: {script_name}")
print(f"==================================================")
t0 = time.time()
cmd = [sys.executable, script_path]
res = subprocess.run(cmd, cwd=project_dir)
t1 = time.time()
if res.returncode == 0:
print(f"[OK] {script_name} PASSED in {t1 - t0:.2f}s (exit code 0)")
return True
else:
print(f"[FAILED] {script_name} FAILED with exit code {res.returncode}")
return False
def main():
print("==================================================")
print(" PROJECT AI ENHANCER MASTER VERIFICATION SUITE ")
print("==================================================")
test_scripts = [
"test_evaluation_workflow.py",
"test_pipeline.py",
"test_ab_ui_pipeline.py",
"test_dataset_loader.py",
"test_stage2_config.py"
]
results = {}
all_passed = True
for script in test_scripts:
passed = run_test_script(script)
results[script] = passed
if not passed:
all_passed = False
print("\n==================================================")
print(" SUMMARY TEST REPORT CARD ")
print("==================================================")
for script, passed in results.items():
status_str = "[OK] PASSED" if passed else "[FAIL] FAILED"
print(f" - {script:<30}: {status_str}")
print("==================================================")
if all_passed:
print("ALL VERIFICATION SUITES PASSED WITH EXIT CODE 0!")
sys.exit(0)
else:
print("ONE OR MORE VERIFICATION SUITES FAILED.")
sys.exit(1)
if __name__ == "__main__":
main()
|