Skip to content

Commit a2dbedd

Browse files
authored
test: isolate legacy SDK environments in cross-version tests (#1353)
The cross-version tests start the 0.3.24 client and server with `uv run --no-project --with ...`. With `--no-project`, uv still builds the `--with` environment on top of the project's .venv. The legacy processes can then import packages from the dev group, which includes a2a-sdk[all]. Because of this, the 0.3 server started in CI without its `http-server` extra and the tests passed. They failed only on machines where .venv did not have sse-starlette (fixed in #1320). Add `--isolated` so that each legacy environment uses a bare interpreter and contains only the dependencies it declares.
1 parent 44b2f76 commit a2dbedd

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎tests/integration/cross_version/client_server/test_client_server.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
import pytest
99

1010

11+
# Use --isolated to not to pull project .venv.
12+
LEGACY_ENV_FLAGS = ['--no-project', '--isolated']
13+
CLIENT_03_DEPS = ['--with', 'a2a-sdk[grpc]==0.3.24', *LEGACY_ENV_FLAGS]
14+
15+
1116
def get_free_port():
1217
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
1318
s.bind(('127.0.0.1', 0))
@@ -128,7 +133,7 @@ def running_servers():
128133
'uvicorn',
129134
'--with',
130135
'fastapi',
131-
'--no-project',
136+
*LEGACY_ENV_FLAGS,
132137
]
133138
s03_cmd = (
134139
[uv_path, 'run']
@@ -192,14 +197,14 @@ def running_servers():
192197
(
193198
'server_0_3.py',
194199
'client_0_3.py',
195-
['--with', 'a2a-sdk[grpc]==0.3.24', '--no-project'],
200+
CLIENT_03_DEPS,
196201
['grpc', 'jsonrpc', 'rest'],
197202
),
198203
# Run 1.0 Server <-> 0.3 Client
199204
(
200205
'server_1_0.py',
201206
'client_0_3.py',
202-
['--with', 'a2a-sdk[grpc]==0.3.24', '--no-project'],
207+
CLIENT_03_DEPS,
203208
['grpc', 'jsonrpc', 'rest'],
204209
),
205210
# Run 1.0 Server <-> 1.0 Client

‎tests/integration/cross_version/test_cross_version_card_validation.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def test_cross_version_agent_card_deserialization() -> None:
158158
'--with',
159159
'a2a-sdk==0.3.24',
160160
'--no-project',
161+
'--isolated',
161162
'python',
162163
'tests/integration/cross_version/validate_agent_cards_030.py',
163164
],

0 commit comments

Comments
 (0)