Spaces:
Runtime error
Runtime error
File size: 2,534 Bytes
95e10ab | 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 79 80 81 82 83 | """
Run all diagnostics for HealthGuard-AI.
This script runs all diagnostic tools in sequence.
"""
import subprocess
import sys
import os
def run_command(command, description):
"""Run a command and print its output."""
print(f"\n{'='*50}")
print(f"Running: {description}")
print(f"Command: {command}")
print('='*50)
try:
result = subprocess.run(command, shell=True, capture_output=True, text=True)
print("STDOUT:")
print(result.stdout)
if result.stderr:
print("STDERR:")
print(result.stderr)
print(f"Return code: {result.returncode}")
return result.returncode == 0
except Exception as e:
print(f"Error running command: {e}")
return False
def main():
"""Main function to run all diagnostics."""
print("HealthGuard-AI Diagnostics Runner")
print("="*50)
# Check current directory
print(f"Current directory: {os.getcwd()}")
# List of diagnostic commands to run
diagnostics = [
("python verify_deployment.py", "Deployment verification"),
("python login_debug.py", "Login component testing"),
("python test_login_flow.py", "Login flow testing"),
("python exact_login_test.py", "Exact login logic testing"),
("python production_login_diagnostic.py", "Production environment diagnostics")
]
# Run each diagnostic
results = []
for command, description in diagnostics:
# Check if file exists before running
script_name = command.split()[1]
if os.path.exists(script_name):
success = run_command(command, description)
results.append((description, success))
else:
print(f"\nSkipping {description} - {script_name} not found")
results.append((description, False))
# Summary
print("\n" + "="*50)
print("DIAGNOSTICS SUMMARY")
print("="*50)
passed = 0
failed = 0
for description, success in results:
status = "PASSED" if success else "FAILED"
print(f"{status}: {description}")
if success:
passed += 1
else:
failed += 1
print(f"\nTotal: {passed} passed, {failed} failed")
if failed == 0:
print("✓ All diagnostics passed!")
else:
print("✗ Some diagnostics failed. Check the output above.")
if __name__ == "__main__":
main() |