Repository navigation
Sprint 4 PR 4.6b — integration tests for constraints router - #236
Merged
Merged
Conversation
Summary: Continues PR 4.6b file-by-file revival of the integration tier. Adds real-HTTP coverage for /api/v1/constraints against the session-scoped uvicorn api_server fixture. Locks in the admin gate on write paths, the authenticated-read requirement, and the org tenancy check. Changed files: - tests/integration/test_constraints.py (new) — 17 tests across create/list/get/update/delete, covering: admin-gate on create/update/ delete, invalid type body rejected (400), volunteer-can-read on list, constraint_type=soft filter, envelope shape, 404s on missing ids, and cross-org create rejected via verify_org_member. Validation: - poetry run pytest tests/integration/test_constraints.py -v — 17 passed - poetry run pytest tests/integration/ -q — 127 passed - poetry run pytest tests/unit -q — 342 passed, 21 skipped - poetry run black tests/integration/test_constraints.py — clean - poetry run ruff check tests/integration/test_constraints.py — clean - No OpenAPI snapshot refresh (no endpoints added or changed). Follow-ups: - Remaining routers still needing integration files: conflicts, holidays, resources, recurring_events, assignments, audit, analytics, calendar, password_reset, solutions, solver, people, webhooks.
tomqwu
marked this pull request as ready for review
July 18, 2026 13:27
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/constraintsrouter over real HTTP against the session-scoped uvicornapi_serverfixture.Coverage
tests/integration/test_constraints.py— 17 tests covering:POST /constraints/— success, admin gate (403 for volunteer), unauthenticated 401/403, invalid type body 400, cross-org 403/404GET /constraints/— envelope shape, default caller-org scoping, volunteer read allowed,constraint_type=softfilterGET /constraints/{id}— success + 404PUT /constraints/{id}— weight + predicate update, invalid type 400, admin gate, 404DELETE /constraints/{id}— success + 404, admin gateValidation
poetry run pytest tests/integration/test_constraints.py -v— 17 passedpoetry run pytest tests/integration/— 127 passed (was 110)poetry run pytest tests/unit -q— 342 passed, 21 skippedpoetry run black tests/integration/test_constraints.py— cleanpoetry run ruff check tests/integration/test_constraints.py— cleanNo OpenAPI snapshot refresh (no endpoints added or changed).
Notes
constraints_orgfixture so admin-gate vs volunteer-forbidden paths can both be exercised.Follow-ups
Remaining routers still to revive under
tests/integration/: conflicts, holidays, resources, recurring_events, assignments, audit, analytics, calendar, password_reset, solutions, solver, people, webhooks.Generated by Claude Code