|
""" |
|
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) |
|
|
|
|
|
tests_dir = Path(__file__).parent |
|
|
|
|
|
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" |
|
] |
|
|
|
|
|
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 |
|
|
|
|
|
try: |
|
exit_code = pytest.main([ |
|
str(test_path), |
|
"-v", |
|
"-s", |
|
"--tb=short", |
|
"--disable-warnings" |
|
]) |
|
|
|
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("\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) |