Skip to content

test: extend selected scenarios to REST - #1370

Open
faheem-shah-umer wants to merge 5 commits into
a2aproject:mainfrom
faheem-shah-umer:test/rest-scenarios
Open

faheem-shah-umer wants to merge 5 commits into
a2aproject:mainfrom
faheem-shah-umer:test/rest-scenarios

Conversation

@faheem-shah-umer

@faheem-shah-umer faheem-shah-umer commented Oct 22, 2026 •

Copy link
Copy Markdown

Extend simple streaming, terminal-task cancellation and artifact delivery scenarios to run over HTTP+JSON alongside gRPC, covering both current and legacy handlers.

Use a module-scoped Starlette application and HTTPX ASGITransport client. Each scenario binds fresh routes and handler state, with per-test cleanup, while the shared HTTP client closes at module teardown.

Validation on Windows / Python 3.10:

  • Selected scenarios: 20 passed.
  • Complete scenario module: 122 passed, 1 existing XPASS.
  • Related end-to-end transport tests: 54 passed.
  • Verified a single module-level REST fixture setup and teardown.
  • Ruff lint, formatting, type checks and git diff --check passed.

The full suite was not rerun locally for this revision. Earlier Windows runs encountered cross-version subprocess cleanup and FastAPI multiprocessing limitations. Full Linux CI verification remains pending.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/agent_execution/active_task_registry.py 97.78% 100.00% 🟢 +2.22%
src/a2a/server/events/event_queue_v2.py 91.79% 92.27% 🟢 +0.48%
src/a2a/utils/telemetry.py 90.70% 91.47% 🟢 +0.78%
Total 93.12% 93.16% 🟢 +0.04%

Generated by coverage-comment.yml

@faheem-shah-umer
faheem-shah-umer marked this pull request as ready for review October 22, 2026 21:10
@faheem-shah-umer
faheem-shah-umer requested a review from a team as a code owner October 22, 2026 21:10
@Iwaniukooo11 Iwaniukooo11 self-assigned this Oct 26, 2026
Comment thread tests/integration/test_scenarios.py Outdated
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as listener:
listener.bind(('127.0.0.1', 0))
port = listener.getsockname()[1]
server = uvicorn.Server(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use httpx.ASGITransport to remove boilerplate code like server setup and port binding

tests/integration/test_end_to_end.py L220 is a good example

Comment thread tests/integration/test_scenarios.py Outdated
listener.bind(('127.0.0.1', 0))
port = listener.getsockname()[1]
server = uvicorn.Server(
uvicorn.Config(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aslo, please set up on httpx server per module/session rather than creating new one per test

@@ -0,0 +1,218 @@
import asyncio

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please drop this file. It checks the test harness rather than the SDK itself and doesn't bring actual coverage

@faheem-shah-umer

Copy link
Copy Markdown
Author

Thanks for the review. I’ve switched to httpx.ASGITransport, shared the HTTP setup at module scope, and removed the cleanup test file. The local tests pass.

This branch has not been deployed

No deployments
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.

2 participants