ModalTranscriberMCP / tests /run_all_tests.py
richard-su's picture
Upload folder using huggingface_hub
76f9cd2 verified
raw
history blame
2.85 kB
"""
Main test runner for all integration tests
δΈ»ζ΅‹θ―•θΏθ‘Œε™¨οΌŒη”¨δΊŽζ‰§θ‘Œζ‰€ζœ‰ι›†ζˆζ΅‹θ―•
"""
import pytest
import sys
import os
from pathlib import Path
def main():
"""Run all integration tests in sequence"""
print("πŸš€ Starting Podcast MCP Gradio Integration Tests")
print("=" * 60)
# Get the tests directory
tests_dir = Path(__file__).parent
# Define test files in execution order
test_files = [
"test_01_podcast_download.py",
"test_02_remote_transcription.py",
"test_03_transcription_file_management.py",
"test_04_mp3_file_management.py",
"test_05_real_world_integration.py"
]
# Test results tracking
results = {}
overall_success = True
for test_file in test_files:
test_path = tests_dir / test_file
print(f"\nπŸ“‹ Running: {test_file}")
print("-" * 40)
if not test_path.exists():
print(f"❌ Test file not found: {test_path}")
results[test_file] = "NOT_FOUND"
overall_success = False
continue
# Run the test file
try:
exit_code = pytest.main([
str(test_path),
"-v", # verbose
"-s", # no capture (show print statements)
"--tb=short", # shorter traceback format
"--disable-warnings" # reduce noise
])
if exit_code == 0:
results[test_file] = "PASSED"
print(f"βœ… {test_file}: PASSED")
else:
results[test_file] = "FAILED"
overall_success = False
print(f"❌ {test_file}: FAILED (exit code: {exit_code})")
except Exception as e:
results[test_file] = f"EXCEPTION: {str(e)}"
overall_success = False
print(f"πŸ’₯ {test_file}: EXCEPTION - {str(e)}")
# Print summary
print("\n" + "=" * 60)
print("πŸ“Š TEST EXECUTION SUMMARY")
print("=" * 60)
for test_file, result in results.items():
status_icon = "βœ…" if result == "PASSED" else "❌"
print(f"{status_icon} {test_file}: {result}")
print(f"\n🏁 Overall Result: {'βœ… SUCCESS' if overall_success else '❌ FAILURES DETECTED'}")
if overall_success:
print("πŸŽ‰ All integration tests completed successfully!")
print("✨ Your Podcast MCP Gradio application is ready for deployment!")
else:
print("⚠️ Some tests failed. Please review the output above.")
print("πŸ”§ Check the specific test failures and fix any issues before deployment.")
return 0 if overall_success else 1
if __name__ == "__main__":
exit_code = main()
sys.exit(exit_code)