Skip to content

test(v2): live contract tests for all 5 client.v2 endpoints#109

Open
yzld2002 wants to merge 2 commits into
mainfrom
feat/v2-contract-tests
Open

test(v2): live contract tests for all 5 client.v2 endpoints#109
yzld2002 wants to merge 2 commits into
mainfrom
feat/v2-contract-tests

Conversation

@yzld2002

Copy link
Copy Markdown
Member

Adds live contract tests for all 5 client.v2 endpointsfiles.upload, extract (sync), extract_jobs (create+wait), parse (sync), parse_jobs (create+wait) — in tests/contract/test_v2_smoke.py (marker contract), plus a small PDF fixture (tests/contract/sample.pdf) for the parse checks.

How they run

  • They plug into the existing pr-gates.yml contract-tests job (rye run pytest tests/contract -m contract -n 0) — no workflow change. That job is scoped to spec-sync/* PRs and skips cleanly without LANDINGAI_ADE_STAGING_APIKEY (forks/local), so ordinary PRs (like this one) are not gated on live staging.
  • Client uses environment="staging" → V2 routes to api.ade.staging.landing.ai. Assertions are structural (types/shape/JobStatus.COMPLETED), not exact-value, since it's a live gateway. wait() calls are bounded (timeout=300).
  • Verified: skips cleanly without the key (6 skipped: 1 V1 + 5 V2); ./scripts/lint clean (ruff + pyright-strict + mypy).

⚠️ Live-verification deferred (staging outage)

As of 2026-07-12, all *.staging.landing.ai hosts return 404 on every path (including the openapi.json endpoints that served 200 on 2026-07-08) — an aide/infra-side change, not a test defect. The pre-existing test_v1_smoke.py and examples/v2_smoke_test.py fail identically, confirming it's environment-level. The same V2 code passed 5/5 live against staging on 2026-07-08, so these tests are correct by construction; a fresh green run is pending staging recovery. (Separately noted: prod V2 is now liveapi.ade.landing.ai/v2/parse → 401, prod spec aide.landing.ai/openapi.json → 200.)

Related: #95 (V2 SDK), the spec-sync contract-tests job in pr-gates.yml.

🤖 Generated with Claude Code

Add tests/contract/test_v2_smoke.py covering files.upload, extract (sync),
extract_jobs (create+wait), parse (sync), and parse_jobs (create+wait)
against live staging, mirroring test_v1_smoke.py conventions.
Copilot AI review requested due to automatic review settings July 12, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds live staging contract coverage for all five synchronous and job-based V2 client surfaces.

Changes:

  • Adds five V2 contract smoke tests.
  • Adds a PDF fixture for parse tests.
  • Uses bounded polling and skips when staging credentials are unavailable.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/contract/test_v2_smoke.py Exercises V2 upload, extract, and parse APIs.
tests/contract/sample.pdf Provides parse-test input.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/contract/test_v2_smoke.py
@yzld2002 yzld2002 added the breaking-change-approved Surface-lock override: a reviewed, intentional public-surface change label Jul 12, 2026
Copilot AI review requested due to automatic review settings July 12, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change-approved Surface-lock override: a reviewed, intentional public-surface change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants