fix: test_03 assertion, test_04 rate-limiting, onboarding reset on restart
AUFGABE 1 — test_03 flexible routing assertion: - Ersetzt starre 'kopieren'/'rüber'-Prüfung durch flexible Keyword-Liste (wechseln, thema, sehe dich, move, raum, rüberkopieren, wechsel) - Zusätzlich: Prüfung auf Zielraum-Namen (rc-test-automated, test-rc-target) - Akzeptiert sowohl Move-Request-Buttons (Butler) als auch Auto-Route-Ankündigung AUFGABE 2 — test_04 rate-limiting: - 10s Pause vor Step 2 (rate-limit window reset nach test_03) - Timeout von 25s auf 30s erhöht - Polling-Intervall (sleep vor Projektraum-Check) von 2s auf 5s erhöht AUFGABE 3 — Onboarding-Reset-Fix: - Drei Stellen in adapter.py connect(): _start_onboarding([]) nur noch aufrufen wenn sm.state != OnboardingState.ACTIVE - Verhindert dass onboarding.yaml bei jedem Gateway-Neustart auf AWAITING_ROOM zurückgesetzt wird, obwohl Onboarding abgeschlossen ist
This commit is contained in:
@@ -108,9 +108,26 @@ def test_03_move_request(
|
||||
logger.info("Test 03: bot move-request text: '%s'", move_req_text[:120])
|
||||
posted_ids_source.append(move_req_msg.get("_id", ""))
|
||||
|
||||
# Verify the move-request contains expected elements
|
||||
assert "kopieren" in move_req_text.lower() or "rüber" in move_req_text.lower(), (
|
||||
f"Move-request message does not contain copy/rüber prompt: '{move_req_text[:200]}'"
|
||||
# Verify the bot response is a valid routing action.
|
||||
# Two valid forms:
|
||||
# A) Move-Request with buttons (Butler mode): contains "kopieren" or "rüber"
|
||||
# B) Auto-Route announcement (100% keyword / FAISS): contains "wechseln",
|
||||
# "thema", "sehe dich", "move", "raum", or the target room name.
|
||||
# Both are valid routing behaviors — the bot either asks for confirmation
|
||||
# (Butler) or auto-routes with an announcement.
|
||||
_routing_keywords = [
|
||||
"kopieren", "rüber", "wechseln", "thema", "sehe dich",
|
||||
"move", "raum", "rüberkopieren", "wechsel",
|
||||
]
|
||||
_has_routing_keyword = any(kw in move_req_text.lower() for kw in _routing_keywords)
|
||||
_has_target_room = (
|
||||
"rc-test-automated" in move_req_text.lower()
|
||||
or "test-rc-target" in move_req_text.lower()
|
||||
)
|
||||
assert _has_routing_keyword or _has_target_room, (
|
||||
f"Bot response is neither a move-request nor an auto-route announcement. "
|
||||
f"Expected routing keywords ({_routing_keywords}) or target room name. "
|
||||
f"Got: '{move_req_text[:200]}'"
|
||||
)
|
||||
|
||||
# Step 3: Simulate button click — post MOVE_REQ:<source_room>::confirm_move
|
||||
|
||||
Reference in New Issue
Block a user