Skip to content

test: thread computers e2e against built wheel - #57

Merged
calvin-archastro merged 1 commit into
mainfrom
test/thread-computers-e2e
Oct 22, 2026
Merged

calvin-archastro merged 1 commit into
mainfrom
test/thread-computers-e2e

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review on ArchCode

Problem and intent

  • ArchDev task tsk_00P3MwVmlsfLC0KnJpssNu ("Published TypeScript and Python SDKs include thread computers") needs proof that the published archastro-sdk (0.11.0, regenerated in chore(sdk): regenerate from openapi@main #55) carries the thread-computer and computer-share methods.
  • No test exercises threads.computers.create/list or agent_computers.update over HTTP, and the CI wheel step only imports the wheel.

What changed

  1. tests/test_thread_computers_e2e.py → test_published_sdk_creates_and_lists_thread_computers_and_updates_computer_shares.
    • http.server.ThreadingHTTPServer loopback with canned responses; records each request.
    • Sync PlatformClient.with_token(api_key, access_token, base_url) → threads.computers.create (POST, 201) → threads.computers.list (GET, 200) → agent_computers.update(..., {"acl": {"grants": []}}) (PATCH, 204).
    • Asserts typed results (AgentComputer, list data, None on 204), the method/path/JSON body sequence, and x-archastro-api-key + Authorization: Bearer + JSON content type on every request.
  2. .github/workflows/ci.yml "Build and import wheel" step: installs the hash-pinned dev group (uv export --locked --only-group dev) into .wheel-smoke, asserts archastro.platform loads from site-packages, then runs the new test against the built wheel.
    • CI selects explicit pytest paths, so the test runs only here (not also from src/).

Scope / risk / user impact

  • Test + CI only. Risk: low. No user impact. Adds a few seconds per matrix leg.

Testing

  • Canonical e2e: tests/test_thread_computers_e2e.py::test_published_sdk_creates_and_lists_thread_computers_and_updates_computer_shares.
    • Actors: installed SDK wheel (httpx runtime) ↔ loopback HTTP server over a real TCP socket.
    • Fidelity: production generated resources + HTTP runtime; the server is canned and records the wire contract only.
    • Not proven here: real platform authorization/provisioning, async client, retries/faults, non-empty acl.add/acl.remove.
  • Runs:
    1. uv run pytest tests/test_thread_computers_e2e.py: 1 passed; ruff check / ruff format --check clean.
    2. Against PyPI archastro-sdk==0.11.0 in fresh venvs (module path confirmed in site-packages): Python 3.11, 3.12, 3.13 → 1 passed each.
    3. The edited CI step run verbatim locally (build wheel → hashed installs → guard → pytest): 1 passed.
    4. Mutation check: renaming the PATCH route in the canned server fails the test with ApiError: not_found.
  • Automatic coverage: CI / Lint + Test (Python 3.11|3.12|3.13) → "Build and import wheel" (PR + push to main).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@calvin-archastro
calvin-archastro merged commit 07aff1d into main Oct 22, 2026
5 checks passed
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.

1 participant