Skip to content

test(api): cover frontend-required routes (#84)#108

Open
hardikuppal04 wants to merge 1 commit into
Second-Origin:devfrom
hardikuppal04:test/84-frontend-route-integration
Open

test(api): cover frontend-required routes (#84)#108
hardikuppal04 wants to merge 1 commit into
Second-Origin:devfrom
hardikuppal04:test/84-frontend-route-integration

Conversation

@hardikuppal04

Copy link
Copy Markdown
Contributor

Summary

  • add ASGI integration coverage for the frontend-required API routes
  • cover the previously missing architecture, engineering-review, owner-delete, AI-config, and AI-connection happy paths
  • verify standard ErrorResponse envelopes and request correlation on representative failures
  • ensure generic 500 responses do not leak exception or traceback text

Why

The frontend depends on these routes across authentication, repositories, analysis, documentation, exports, and AI settings. This gives each route a real success path and an error contract check without changing runtime behavior.

Validation

  • python -m pytest --basetemp ..\\.pytest-tmp-84-audit-focused ...: 106 passed, 1 skipped
  • python -m pytest --ignore=tests/benchmark --basetemp ..\\.pytest-tmp-84-audit-nonbenchmark: 323 passed, 4 skipped
  • python -m pip check: no broken requirements

The complete local suite has two unrelated benchmark assertions on Windows because a fixture checked in as LF is materialized as CRLF (97 bytes instead of the manifest's 96). No benchmark files are part of this PR.

Closes #84

@SHAURYAKSHARMA24
SHAURYAKSHARMA24 self-requested a review July 17, 2026 21:58
@hardikuppal04
hardikuppal04 marked this pull request as ready for review July 17, 2026 21:59

@SHAURYAKSHARMA24 SHAURYAKSHARMA24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work on this, Hardik. The overall approach is solid and the added route coverage is useful, but I found two issues that need addressing before approval:

  1. Make assert_error_response enforce the exact response contract.
    ErrorResponse.model_validate() currently accepts missing optional fields and silently ignores unexpected fields. This means a response missing details, or even containing an unexpected field such as traceback, can pass. Please require exactly code, message, details, and request_id, and add focused tests for missing fields, unexpected fields, and mismatched request IDs.

  2. Add a failure-path contract test for POST /auth/logout.
    The current logout test only covers successful/idempotent 204 responses. Issue #84 requires both a happy path and a failure path for each frontend-required route. Please add a deterministic ASGI integration test for a documented logout failure (429 or 500) and validate it with the strict shared error helper. If testing 500, also confirm no exception or traceback information is exposed.

Please keep the changes narrowly scoped, reuse the existing fixtures, and include the relevant focused and non-benchmark backend test results when ready for re-review.

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.

chore: integration test coverage for frontend-required routes

2 participants