Skip to content

Sprint 4 PR 4.6b — integration tests for recurring-series router - #240

Merged
tomqwu merged 1 commit into
mainfrom
sprint-4-pr-4-6b-recurring-events-integration
Jul 19, 2026
Merged

tomqwu merged 1 commit into
mainfrom
sprint-4-pr-4-6b-recurring-events-integration

Conversation

@tomqwu

@tomqwu tomqwu commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Continues Sprint 4 PR 4.6b (file-by-file revival of the tests/integration/ tier). Adds a production-endpoint integration file that drives the /recurring-series router over real HTTP against the session-scoped uvicorn api_server fixture. Covers the full lifecycle: create + occurrence generation, dry-run preview, list envelope, per-series occurrence listing, template update, and cascade delete.

Coverage

tests/integration/test_recurring_events.py — 16 tests covering:

  • POST /recurring-series — weekly-Monday series creates + generates 4 occurrences, admin gate (volunteer 403), cross-org 403
  • POST /recurring-series/preview — returns pattern occurrences (sequence starts at 1), works for volunteers (read-only endpoint)
  • GET /recurring-series — envelope shape, org scoping, cross-org 403
  • GET /recurring-series/{id} — success + 404
  • GET /recurring-series/{id}/occurrences — occurrence_sequence order preserved
  • PUT /recurring-series/{id} — title + location update (admin), volunteer 403, 404
  • DELETE /recurring-series/{id} — cascade removes series + occurrences (occurrences_deleted: 3 verified), admin gate, 404

Validation

  • poetry run pytest tests/integration/test_recurring_events.py -v — 16 passed
  • poetry run black tests/integration/test_recurring_events.py — clean
  • poetry run ruff check tests/integration/test_recurring_events.py — clean

No OpenAPI snapshot refresh (no endpoints added or changed).

Notes

  • Series start_date sits 14+ days in the future to avoid tripping the validate_series_duration past-window guard.
  • The delete cascade assertion locks in the router's own occurrences_deleted count (not just a soft "series is gone" check), so a regression where the loop misses events would be caught.

Follow-ups

Remaining routers still to revive under tests/integration/: assignments, audit, analytics, calendar, password_reset, solutions, solver, people, webhooks.


Generated by Claude Code

Summary: Continues PR 4.6b file-by-file revival of the integration tier.
Adds real-HTTP coverage for /api/v1/recurring-series across create,
preview, list, get, per-series occurrence listing, template update, and
cascade delete.

Changed files:
- tests/integration/test_recurring_events.py (new) — 16 tests spanning
  create/preview/list/get/occurrences/update/delete, covering: admin gate
  on all writes, cross-org 403, preview endpoint works for volunteer,
  envelope shape on list, occurrence_sequence ordering on the
  /occurrences endpoint, cascade delete count assertion, 404 on missing.

Validation:
- poetry run pytest tests/integration/test_recurring_events.py -v — 16 passed
- poetry run black tests/integration/test_recurring_events.py — clean
- poetry run ruff check tests/integration/test_recurring_events.py — clean
- No OpenAPI snapshot refresh (no endpoints added or changed).

Follow-ups:
- Remaining integration files to revive: assignments, audit, analytics,
  calendar, password_reset, solutions, solver, people, webhooks.
@tomqwu
tomqwu marked this pull request as ready for review July 19, 2026 13:03
@tomqwu
tomqwu merged commit 5d72154 into main Jul 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants