Repository navigation
Sprint 4 PR 4.6b — integration tests for conflicts router - #237
Merged
Merged
Conversation
Summary: Continues PR 4.6b file-by-file revival of the integration tier.
Adds real-HTTP coverage for /api/v1/conflicts against the session-scoped
uvicorn api_server. Exercises both the pre-assignment /check endpoint and
the admin-only org-wide GET / listing across the three conflict types
(already_assigned, time_off, double_booked).
Changed files:
- tests/integration/test_conflicts.py (new) — 14 tests covering:
- POST /conflicts/check: no-conflict happy path, already_assigned blocks,
time_off blocks, double_booked warns but can_assign remains true,
404 on missing person, 404 on missing event
- GET /conflicts/: empty envelope shape, time_off + double_booked
surfacing, person_id filter narrowing, admin gate (volunteer 403),
unauth 401/403, cross-org 403, pagination envelope fields
Validation:
- poetry run pytest tests/integration/test_conflicts.py -v — 14 passed
- poetry run pytest tests/integration/ -q — 124 passed
- poetry run black tests/integration/test_conflicts.py — clean
- poetry run ruff check tests/integration/test_conflicts.py — clean
- No OpenAPI snapshot refresh (no endpoints added or changed).
Follow-ups:
- Remaining integration files to revive: holidays, resources,
recurring_events, assignments, audit, analytics, calendar,
password_reset, solutions, solver, people, webhooks.
tomqwu
marked this pull request as ready for review
July 19, 2026 13:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/conflictsrouter over real HTTP against the session-scoped uvicornapi_serverfixture. Exercises both the pre-assignmentPOST /checkand the admin-only org-wideGET /listing across all three conflict types (already_assigned, time_off, double_booked).Coverage
tests/integration/test_conflicts.py— 14 tests covering:POST /conflicts/check— no-conflict happy path (can_assign=true), already_assigned blocks (can_assign=false), time_off blocks, double_booked surfaces conflict but keepscan_assign=true(per router contract), 404 on missing person, 404 on missing eventGET /conflicts/— empty envelope shape, time_off + double_booked surfacing on real assignments,person_id=filter narrowing, admin gate (volunteer 403), unauth 401/403, cross-org 403,limit+offsetechoed in envelopeValidation
poetry run pytest tests/integration/test_conflicts.py -v— 14 passedpoetry run pytest tests/integration/— 124 passed (was 110)poetry run black tests/integration/test_conflicts.py— cleanpoetry run ruff check tests/integration/test_conflicts.py— cleanNo OpenAPI snapshot refresh (no endpoints added or changed).
Notes
check_time_overlapfires deterministically.POST /availability/{person_id}/timeoff(an unauthenticated endpoint today) to seed the vacation period, then admin-assigns the volunteer, then checks the listing._add_timeoffandPOST /conflicts/checkuse anon httpx.Client instances because those endpoints don't require auth on the current router.conflicts_orgfixture so cross-test state can't influence conflict detection.Follow-ups
Remaining routers still to revive under
tests/integration/: holidays, resources, recurring_events, assignments, audit, analytics, calendar, password_reset, solutions, solver, people, webhooks.Generated by Claude Code