2b3290c73c
scripts/e2e_smoke.py + tests/test_e2e.py verify the full v0.1 loop without live API keys (heuristic classifier + stub debrief LLM): start session → simulate 4 turns → classify branch (R7 offline) → generate debrief (stub LLM, guardrail-filtered) → end session → assert DB rows (session + turns + cost + debrief), latency < budget (or logged). Running the script prints a result summary (session_id, branch_id, outcome, turns_logged, cost_cents, debrief_chars, max_latency_ms, within_budget). 3 pytest assertions pass (full loop, debrief non-empty, cost non-null). Final verification: 73 server tests pass, client typecheck + build + test pass. All 26 PLAN.md tasks across 5 slices complete. ---ci--- phase: 1 milestone: v0.1 plan: 05 task: 05-06 status: execute persona: lead-developer requirements: covered: [REQ-VOICE-01, REQ-VOICE-02, REQ-VOICE-03, REQ-VOICE-04, REQ-SCEN-01, REQ-STATE-01, REQ-LLM-01, REQ-LLM-02, REQ-DEBRIEF-01, REQ-ORCH-01, REQ-ORCH-02, REQ-SCEN-FMT-01, REQ-NFR-LAT-01, REQ-NFR-SAFE-01, REQ-NFR-COST-01] ---/ci---
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
"""End-to-end smoke test (TASK-05-06) — pytest entry point.
|
|
|
|
Runs scripts/e2e_smoke.py::run_e2e and asserts the full loop:
|
|
session → turns → branch → debrief → DB logged.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import asyncio
|
|
|
|
import pytest
|
|
|
|
from scripts.e2e_smoke import run_e2e
|
|
|
|
|
|
def test_e2e_full_loop(tmp_db):
|
|
"""The full v0.1 loop completes and DB assertions pass (no live keys needed)."""
|
|
result = asyncio.run(run_e2e(db_path=str(tmp_db)))
|
|
assert result["branch_id"] in ("accept_resolution", "escalate")
|
|
assert result["turns_logged"] == 4
|
|
assert result["cost_cents"] >= 0
|
|
assert result["debrief_chars"] > 0
|
|
# Latency is logged (within or over budget); the test asserts it's logged,
|
|
# not that it's within budget (that requires live keys + real network).
|
|
assert result["max_latency_ms"] > 0
|
|
assert result["budget_ms"] == 600.0
|
|
|
|
|
|
def test_e2e_debrief_non_empty(tmp_db):
|
|
"""The debrief text is non-empty (TASK-05-06 must-have)."""
|
|
result = asyncio.run(run_e2e(db_path=str(tmp_db)))
|
|
assert result["debrief_chars"] > 50 # a real debrief is more than a stub
|
|
|
|
|
|
def test_e2e_cost_non_null(tmp_db):
|
|
"""cost_estimated_cents is non-null for a completed session (TASK-05-06 must-have)."""
|
|
result = asyncio.run(run_e2e(db_path=str(tmp_db)))
|
|
assert result["cost_cents"] is not None |