Files
odysseus/tests/smoke/test_settings_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

32 lines
1.2 KiB
Python

"""Settings: a preference written through the API survives a new login.
Reading the value back on the same cookie only proves the handler
answered. Reading it back after authenticating again is what proves it
was persisted rather than held in the session, which is the closest an
API-level check gets to the user reloading the page.
"""
from __future__ import annotations
PREFS_PATH = "/api/prefs"
KEY = "odysseus_smoke_preference"
VALUE = "set-by-the-release-smoke-suite"
def test_a_preference_survives_a_new_login(client, fresh_client):
written = client.put(f"{PREFS_PATH}/{KEY}", json={"value": VALUE})
assert written.status_code == 200, written.text
assert written.json().get("value") == VALUE, written.text
read = client.get(f"{PREFS_PATH}/{KEY}")
assert read.status_code == 200, read.text
assert read.json().get("value") == VALUE, read.text
reloaded = fresh_client.get(f"{PREFS_PATH}/{KEY}")
assert reloaded.status_code == 200, reloaded.text
assert reloaded.json().get("value") == VALUE, reloaded.text
listed = fresh_client.get(PREFS_PATH)
assert listed.status_code == 200, listed.text
assert listed.json().get(KEY) == VALUE, listed.text