run_all_tests.pyโข2.81 kB
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
๐ ๋ชจ๋ ๊ณต์ ๊ฒ์ฆ ํ
์คํธ ์คํ
ํด์ปคํค ๊ณต์ ๊ฒ์ฆ ๊ธฐ์ค์ ๋ฐ๋ฅธ ๋ชจ๋ ํ
์คํธ๋ฅผ ์์ฐจ์ ์ผ๋ก ์คํํฉ๋๋ค.
"""
import sys
import os
import time
# ํ์ฌ ๋๋ ํ ๋ฆฌ๋ฅผ Python ๊ฒฝ๋ก์ ์ถ๊ฐ
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from test_1_command_line_parameters import CommandLineParametersTest
from test_2_continuous_break import ContinuousBreakTest
from test_3_stress_accumulation import StressAccumulationTest
from test_4_delay_when_boss_alert_5 import DelayWhenBossAlert5Test
from test_5_response_parsing import ResponseParsingTest
from test_6_cooldown import CooldownTest
def run_all_tests():
"""๋ชจ๋ ํ
์คํธ ์คํ"""
print("\n" + "="*70)
print(" [TEST] ChillMCP ๊ณต์ ๊ฒ์ฆ ํ
์คํธ")
print(" ํด์ปคํค ์๊ตฌ์ฌํญ ์ค์ ์ฌ๋ถ ํ์ธ")
print("="*70)
tests = [
("ํ
์คํธ 1: ์ปค๋งจ๋๋ผ์ธ ํ๋ผ๋ฏธํฐ", CommandLineParametersTest),
("ํ
์คํธ 2: ์ฐ์ ํด์", ContinuousBreakTest),
("ํ
์คํธ 3: ์คํธ๋ ์ค ๋์ ", StressAccumulationTest),
("ํ
์คํธ 4: Boss Alert Level 5 ์ง์ฐ", DelayWhenBossAlert5Test),
("ํ
์คํธ 5: ์๋ต ํ์ฑ", ResponseParsingTest),
("ํ
์คํธ 6: Cooldown", CooldownTest),
]
total_passed = 0
total_failed = 0
results = []
for test_name, test_class in tests:
print(f"\n{'='*70}")
print(f" ์คํ ์ค: {test_name}")
print(f"{'='*70}")
try:
test_instance = test_class()
success = test_instance.run_test()
if success:
total_passed += 1
results.append(f"[PASS] {test_name}: ํต๊ณผ")
else:
total_failed += 1
results.append(f"[FAIL] {test_name}: ์คํจ")
except Exception as e:
total_failed += 1
results.append(f"[ERROR] {test_name}: ์์ธ ๋ฐ์ - {str(e)}")
print(f" ์์ธ ๋ฐ์: {e}")
# ํ
์คํธ ๊ฐ ์ ์ ๋๊ธฐ
time.sleep(2)
# ์ต์ข
๊ฒฐ๊ณผ
print("\n" + "="*70)
print(" ๐ ์ต์ข
๊ฒฐ๊ณผ")
print("="*70)
for result in results:
print(f" {result}")
print(f"\n ์ด ํต๊ณผ: {total_passed}")
print(f" ์ด ์คํจ: {total_failed}")
print(f" ์ฑ๊ณต๋ฅ : {total_passed / (total_passed + total_failed) * 100:.1f}%")
print("="*70)
if total_failed == 0:
print("\n [SUCCESS] ๋ชจ๋ ํ
์คํธ ํต๊ณผ!")
return True
else:
print(f"\n [WARN] {total_failed}๊ฐ ํ
์คํธ ์คํจ")
return False
if __name__ == "__main__":
success = run_all_tests()
sys.exit(0 if success else 1)