Skip to content

Sprint 4 PR 4.6b — integration tests for holidays router - #238

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

tomqwu merged 1 commit into
mainfrom
sprint-4-pr-4-6b-holidays-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 /holidays router over real HTTP against the session-scoped uvicorn api_server fixture, including the admin-only bulk-import path.

Coverage

tests/integration/test_holidays.py — 17 tests covering:

  • POST /holidays/ — success, admin gate (volunteer 403), cross-org 403/404
  • POST /holidays/bulk — success (3 rows created), within-batch duplicate date reported as skipped+error, admin gate
  • GET /holidays/ — envelope shape (items/total/limit/offset), org scoping, volunteer can read, cross-org 403
  • GET /holidays/{id} — success + 404
  • PUT /holidays/{id} — label update, admin gate, 404
  • DELETE /holidays/{id} — success + 404, admin gate

Validation

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

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

Notes

  • Bulk-import date offsets sit far in the future (100+ days) so they don't overlap with the single-create test's date (~60 days).
  • The within-batch de-dup assertion verifies the router returns errors[0].row == 1 and both created==1, skipped==1, locking in the exact contract.

Follow-ups

Remaining routers still to revive under tests/integration/: resources, recurring_events, 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/holidays: single-create, admin bulk
import (including within-batch de-dup), list envelope + org scoping, get,
update, delete.

Changed files:
- tests/integration/test_holidays.py (new) — 17 tests across
  create/bulk/list/get/update/delete, covering: admin gate on writes,
  volunteer can read list, cross-org 403 on both create and list, bulk
  reports created/skipped/errors correctly with duplicate dates in the
  same request, envelope shape, 404s on missing ids.

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

Follow-ups:
- Remaining integration files to revive: resources, recurring_events,
  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 11e50af 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