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

42 lines
1.5 KiB
Python

"""Tasks: a scheduled task is created with a computed next run and is listed.
Deliberately not fired. Running a task is model and tool work the
checkpoint benchmark covers; what this asserts is that the scheduler
still accepts a task and computes when it should run, which is the part
a route move can break silently.
"""
from __future__ import annotations
TASKS_PATH = "/api/tasks"
NAME = "Odysseus smoke task"
SCHEDULED_TIME = "03:00"
def test_a_scheduled_task_round_trips(client):
created = client.post(TASKS_PATH, json={
"name": NAME,
"task_type": "llm",
"prompt": "Smoke task; never run by this suite.",
"trigger_type": "schedule",
"schedule": "daily",
"scheduled_time": SCHEDULED_TIME,
})
assert created.status_code == 200, created.text
body = created.json()
task_id = body["id"]
try:
assert body.get("next_run"), f"no next run computed for a daily task: {body}"
assert body.get("status") == "active", body
listed = client.get(TASKS_PATH)
assert listed.status_code == 200, listed.text
assert task_id in [t.get("id") for t in listed.json().get("tasks") or []]
paused = client.post(f"{TASKS_PATH}/{task_id}/pause")
assert paused.status_code == 200, paused.text
assert client.get(f"{TASKS_PATH}/{task_id}").json().get("status") == "paused"
finally:
removed = client.delete(f"{TASKS_PATH}/{task_id}")
assert removed.status_code == 200, removed.text