Files
odysseus/tests/smoke/test_cookbook_smoke.py
T
Léo 12f74ec9ea test(smoke): add a release smoke suite over every advertised feature area
The decomposition lanes have two safety nets and neither covers the
product. The checkpoint benchmark measures the agent runtime; the
computed-style snapshot pins the CSS. Nothing checked that Notes,
Calendar, Documents, Email, Memory, Cookbook or Settings still worked
after a route package moved or a 17,000-line module was split - and the
unit suite does not, since a byte-identical file move can break tests
that pass on the base branch with CI green throughout. The 28 Playwright
specs we do have are all under tests/e2e/photo-editor/ and no workflow
runs them.

scripts/odysseus-smoke boots this worktree through `odysseus dev` and
runs tests/smoke/: one scenario per area, each asserting a user-visible
outcome rather than a status code. Models come from a deterministic
OpenAI-compatible stub on an ephemeral loopback port; email reuses the
existing ODYSSEUS_EMAIL_FIXTURE path rather than inventing a second
mechanism. No scenario touches a live endpoint or the network.

The report is a per-area table that prints the areas the suite does not
cover next to the ones it does, and builds its rows from the registry
rather than from what happened to run, so an area cannot go missing by
having its module deleted or renamed. Under a plain pytest with nothing
booted every scenario skips with the reason, so the full suite stays
green.
2026-09-30 12:12:58 +02:00

51 lines
1.8 KiB
Python

"""Cookbook: hardware is detected and the recommendations are sized against it.
What the README advertises here is hardware-aware recommendation, and
that is exactly the part that runs offline. Downloading and serving a
model is left to the gap list: it needs tmux, a GPU runtime and several
gigabytes over the network.
"""
from __future__ import annotations
SYSTEM_PATH = "/api/hwfit/system"
MODELS_PATH = "/api/hwfit/models"
STATE_PATH = "/api/cookbook/state"
GPUS_PATH = "/api/cookbook/gpus"
STATE_MARKER = "odysseusSmokeMarker"
def test_hardware_is_detected(client):
response = client.get(SYSTEM_PATH)
assert response.status_code == 200, response.text
system = response.json()
assert (system.get("total_ram_gb") or 0) > 0, system
assert (system.get("cpu_cores") or 0) > 0, system
assert system.get("cpu_name"), system
gpus = client.get(GPUS_PATH)
assert gpus.status_code == 200, gpus.text
assert gpus.json().get("ok") is True, gpus.text
def test_recommendations_fit_the_detected_hardware(client):
response = client.get(MODELS_PATH)
assert response.status_code == 200, response.text
body = response.json()
system = body.get("system") or {}
assert system.get("cpu_name"), body
recommended = body.get("models") or body.get("recommendations") or []
assert recommended, f"no model recommendation for this hardware: {list(body)}"
def test_cookbook_state_persists(client):
written = client.post(STATE_PATH, json={STATE_MARKER: "ody-95"})
assert written.status_code == 200, written.text
assert written.json().get("ok") is True, written.text
read = client.get(STATE_PATH)
assert read.status_code == 200, read.text
assert read.json().get(STATE_MARKER) == "ody-95", read.text
client.post(STATE_PATH, json={})