harden: per-item robustness + deadlines/caps across connectors; layered tests

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>
This commit is contained in:
Stefan Lohmaier
2026-06-24 21:17:26 +02:00
co-authored by Claude Opus 4.8
parent 936ebc2f56
commit c9ccb4392b
26 changed files with 719 additions and 65 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
# MCP Voll-Tests — ON-DEMAND (NICHT naechtlich; manuell ausfuehren).
# Funktional (test_all.py) + Edge-Cases (test_edge.py) + Stress/Concurrency (test_stress.py).
# Schreibt Testdaten in die mcptest-Sandbox (calendar-test, contacts-test, /.mcp-tests*, Inbox).
#
# Nutzung:
# /opt/mcp-servers/tests/run_full_tests.sh # alles
# /opt/mcp-servers/tests/run_full_tests.sh -m stress # nur eine Schicht (pytest-Marker)
set -uo pipefail
LOG="/var/log/mcp-tests-full.log"
VENV="/opt/mcp-servers/venv/bin"
cd /opt/mcp-servers/tests || exit 1
echo "[$(date)] MCP Voll-Tests gestartet" | tee -a "$LOG"
if [ "$#" -gt 0 ]; then
# z.B. -m smoke | -m edge | -m stress (Marker-basiert ueber alle Dateien)
OUTPUT=$($VENV/python -m pytest test_all.py test_edge.py test_stress.py "$@" -v --tb=short 2>&1)
else
OUTPUT=$($VENV/python -m pytest test_all.py test_edge.py test_stress.py -v --tb=short 2>&1)
fi
EXIT=$?
echo "$OUTPUT" | tee -a "$LOG"
echo "$OUTPUT" | tail -1
echo "[$(date)] MCP Voll-Tests fertig (exit $EXIT)" | tee -a "$LOG"
exit $EXIT