Add a real Django/DB-backed integration test tier for the endpoint trust boundary#164
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR adds a postgres-marked Django integration tier, wires it into CI, and updates pytest configuration, shared test fixtures, endpoint and ORM integration tests, and developer documentation. ChangesPostgreSQL Integration Test Tier
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ci as .github/workflows/ci.yml
participant workflow as .github/workflows/ci-postgres.yml
participant postgres as postgres:16-alpine
participant pytest as pytest -m postgres
ci->>workflow: invoke postgres job
workflow->>postgres: start database service
workflow->>pytest: run integration tests with DB env vars
pytest->>postgres: read/write test data
postgres-->>pytest: query results
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/django_integration_settings.py (1)
30-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant branching for INSTALLED_APPS append.
+=works identically for both list and tuple targets here (tuple concatenation vs. list extend), so theisinstancecheck adds complexity without behavioral difference.♻️ Simplification
if _ENDPOINT_APP_CONFIG not in INSTALLED_APPS: # noqa: F405 - if isinstance(INSTALLED_APPS, tuple): # noqa: F405 - INSTALLED_APPS = INSTALLED_APPS + (_ENDPOINT_APP_CONFIG,) # noqa: F405 - else: - INSTALLED_APPS += (_ENDPOINT_APP_CONFIG,) # noqa: F405 + INSTALLED_APPS += (_ENDPOINT_APP_CONFIG,) # noqa: F405🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/django_integration_settings.py` around lines 30 - 34, The INSTALLED_APPS update in the Django integration settings has redundant type branching, since the append behavior is the same for both list and tuple targets. Simplify the logic around _ENDPOINT_APP_CONFIG by removing the isinstance(INSTALLED_APPS, tuple) conditional and using a single += path in the INSTALLED_APPS block so the code remains equivalent but easier to read and maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/django_integration_settings.py`:
- Around line 30-34: The INSTALLED_APPS update in the Django integration
settings has redundant type branching, since the append behavior is the same for
both list and tuple targets. Simplify the logic around _ENDPOINT_APP_CONFIG by
removing the isinstance(INSTALLED_APPS, tuple) conditional and using a single +=
path in the INSTALLED_APPS block so the code remains equivalent but easier to
read and maintain.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 24bb8ef1-ec0f-4868-bb48-72d423784f37
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
.github/workflows/ci-postgres.yml.github/workflows/ci.ymlCONTRIBUTING.mdREADME.mdpyproject.tomltests/conftest.pytests/django_integration_settings.pytests/endpoint/test_views.pytests/postgres/__init__.pytests/postgres/conftest.pytests/postgres/test_endpoint_trust_boundary.pytests/postgres/test_services_orm.py
henry0816191
left a comment
There was a problem hiding this comment.
Add a row in .github/WORKFLOWS.md- Workflows table - lines 13–28 forci-postgres.ymlafterci-test.yml` (DB-backed integration tests, Python 3.12, PostgreSQL service container).
Close #160.
Summary by CodeRabbit
add-or-updateAPI trust boundary.pytest -m postgres.DJANGO_SETTINGS_MODULEis honored when pre-set; improved transaction-related test isolation.