Files
odysseus/tests/smoke/test_calendar_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
2.0 KiB
Python

"""Calendar: an event created through the API shows up in the range the UI asks for."""
from __future__ import annotations
from datetime import datetime, timedelta
CALENDARS_PATH = "/api/calendar/calendars"
EVENTS_PATH = "/api/calendar/events"
SUMMARY = "Odysseus smoke event"
# Far enough out that a real local calendar's own entries cannot collide
# with the assertion, and fixed relative to now so the window is never
# empty for date reasons.
DAYS_AHEAD = 30
def test_an_event_round_trips(client):
listed_calendars = client.get(CALENDARS_PATH)
assert listed_calendars.status_code == 200, listed_calendars.text
assert listed_calendars.json().get("calendars"), "no calendar to write an event into"
start = (datetime.now() + timedelta(days=DAYS_AHEAD)).replace(
hour=10, minute=0, second=0, microsecond=0)
created = client.post(EVENTS_PATH, json={
"summary": SUMMARY,
"dtstart": start.isoformat(),
})
assert created.status_code == 200, created.text
uid = created.json()["uid"]
try:
window = client.get(EVENTS_PATH, params={
"start": (start - timedelta(days=1)).isoformat(),
"end": (start + timedelta(days=1)).isoformat(),
})
assert window.status_code == 200, window.text
events = window.json().get("events") or []
matching = [e for e in events if e.get("uid") == uid]
assert matching, [e.get("summary") for e in events]
assert matching[0].get("summary") == SUMMARY, matching[0]
read = client.get(f"{EVENTS_PATH}/{uid}")
assert read.status_code == 200, read.text
finally:
removed = client.delete(f"{EVENTS_PATH}/{uid}")
assert removed.status_code == 200, removed.text
after = client.get(EVENTS_PATH, params={
"start": (start - timedelta(days=1)).isoformat(),
"end": (start + timedelta(days=1)).isoformat(),
})
assert uid not in [e.get("uid") for e in after.json().get("events") or []]