Mail: _safe_decode + _iter_messages (per-mail try/except) -> eine kaputte Mail (charset x-unknown) bricht die Suche nicht mehr ab, findet so auch uralte Mails. Vollscan + Datum-Sort + MAX_SCAN/DEADLINE_S (Selbstheilung, kein 24h-Haenger mehr). Files: search_files mit SEARCH_DEADLINE_S + SEARCH_MAX_DIRS begrenzt (war unbegrenzte rekursive PROPFIND -> real 35s/449 Calls). Calendar/Contacts: PARSE_DEADLINE_S fuer client-seitiges vobject-Parsen; MAX_RESULTS-Output-Cap in get_events/get_tasks (war 10939 Zeilen bei 6000 Events); search Top-N + Hinweise. Tests: in Schichten getrennt -> Smoke (nightly), Edge + Stress (on-demand). Neu: test_smoke/test_edge/test_stress + conftest-Marker + run_full_tests.sh, nightly laeuft nur Smoke. Kontakt-Foto-Roundtrip-Test, Mail-Edge-Mails (x-unknown, kaputter Header, 2009er Alt-Mail). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
29 lines
984 B
Bash
Executable File
29 lines
984 B
Bash
Executable File
#!/bin/bash
|
|
# MCP Smoke-Tests — laeuft taeglich via systemd timer (mcp-tests.timer 05:00).
|
|
# NUR Smoke (Server up + Auth + 1 Read/Connector). Stress/Edge/Funktional laufen
|
|
# NICHT naechtlich -> on-demand via run_full_tests.sh.
|
|
set -uo pipefail
|
|
|
|
LOG="/var/log/mcp-tests.log"
|
|
NTFY_TOPIC="admin"
|
|
VENV="/opt/mcp-servers/venv/bin"
|
|
|
|
echo "[$(date)] MCP Smoke-Tests gestartet" | tee -a "$LOG"
|
|
|
|
OUTPUT=$(cd /opt/mcp-servers/tests && $VENV/python -m pytest test_smoke.py -v --tb=short 2>&1)
|
|
EXIT=$?
|
|
|
|
echo "$OUTPUT" | tee -a "$LOG"
|
|
|
|
if [ $EXIT -eq 0 ]; then
|
|
PASSED=$(echo "$OUTPUT" | grep -oP '\d+ passed' | head -1)
|
|
echo "[$(date)] MCP Smoke-Tests OK: $PASSED" | tee -a "$LOG"
|
|
else
|
|
FAILED=$(echo "$OUTPUT" | grep "FAILED" | head -5)
|
|
echo "[$(date)] MCP Smoke-Tests FEHLGESCHLAGEN" | tee -a "$LOG"
|
|
/usr/local/bin/notify-ntfy "$NTFY_TOPIC" "MCP Smoke-Tests fehlgeschlagen" \
|
|
"$(echo "$FAILED" | head -3)\n\nLog: tail -50 $LOG" "urgent" "x,test_tube"
|
|
fi
|
|
|
|
exit $EXIT
|