Files
mtusi2026lab4/student-tests/run_all.py
T
Mikhail Verkovykh 728e53cc55 Реализовать lab4 на оценку 4: SeaweedFS, вложения и согласованность БД/S3.
Перенесён стенд lab3 (API, Redis-сессии, идемпотентность, HAProxy, реплики API). Добавлены приватный bucket SeaweedFS с отдельным ключом API, загрузка PNG/JPEG с лимитами и полной проверкой, компенсация и reconciler, плавная остановка API, тесты и evidence.
2026-11-06 19:48:37 +03:00

50 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Run all student tests against a live API (BASE_URL)."""
from __future__ import annotations
import importlib
import sys
import traceback
MODULES = [
"test_images_unit",
"test_api",
"test_concurrency",
"test_sessions",
"test_idempotency",
"test_attachments",
"test_attachments_ops",
"test_shutdown",
"test_deps",
]
def main() -> int:
failed = 0
passed = 0
only = set(sys.argv[1:])
for name in MODULES:
if only and name not in only:
continue
mod = importlib.import_module(name)
tests = [getattr(mod, n) for n in dir(mod) if n.startswith("test_")]
for fn in tests:
label = f"{name}.{fn.__name__}"
try:
fn()
print("OK", label)
passed += 1
except Exception as exc:
failed += 1
print("FAIL", label, ":", exc)
traceback.print_exc()
print(f"Summary: {passed} passed, {failed} failed")
return 1 if failed else 0
if __name__ == "__main__":
sys.path.insert(0, ".")
raise SystemExit(main())