Skip to content

Commit 8aa1200

Browse files
CopilotJesuTerraz
andauthored
Align Google ADK extension with tooling extension conventions (#158)
* Initial plan * Fix setup.py consistency and add @pytest.mark.unit decorators Co-authored-by: JesuTerraz <96103167+JesuTerraz@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JesuTerraz <96103167+JesuTerraz@users.noreply.github.com>
1 parent 5b58669 commit 8aa1200

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

libraries/microsoft-agents-a365-tooling-extensions-google/setup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515

1616
from setup_utils import get_dynamic_dependencies # noqa: E402
1717

18-
# Use minimum version strategy:
19-
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
20-
# - Automatically updates when you build new versions
21-
# - Consumers can upgrade to any higher version
18+
# Use exact version matching for internal dependencies:
19+
# - Internal packages get: == current_version (e.g., == 1.2.3)
20+
# - Ensures all SDK packages must be at the same version
21+
# - Prevents incompatibility issues from version mismatches
2222
setup(
2323
version=package_version,
2424
install_requires=get_dynamic_dependencies(
25-
use_compatible_release=False, # No upper bound
26-
use_exact_match=False, # Not exact match
25+
use_exact_match=True,
2726
),
2827
)

tests/tooling/extensions/google/test_mcp_tool_registration_service.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class TestMcpToolRegistrationServiceInit:
1212
"""Tests for McpToolRegistrationService initialization."""
1313

14+
@pytest.mark.unit
1415
def test_init_default_logger(self):
1516
"""Test initialization with default logger."""
1617
with patch(
@@ -24,6 +25,7 @@ def test_init_default_logger(self):
2425
assert service.config_service is not None
2526
assert service._connected_servers == []
2627

28+
@pytest.mark.unit
2729
def test_init_custom_logger(self):
2830
"""Test initialization with custom logger."""
2931
import logging
@@ -39,6 +41,7 @@ def test_init_custom_logger(self):
3941

4042
assert service._logger is custom_logger
4143

44+
@pytest.mark.unit
4245
def test_orchestrator_name(self):
4346
"""Test that orchestrator name is set correctly."""
4447
with patch(
@@ -91,6 +94,7 @@ def mock_server_config(self):
9194
return mock
9295

9396
@pytest.mark.asyncio
97+
@pytest.mark.unit
9498
async def test_add_tool_servers_exchanges_token_when_not_provided(
9599
self, mock_agent, mock_authorization, mock_turn_context
96100
):
@@ -136,6 +140,7 @@ async def test_add_tool_servers_exchanges_token_when_not_provided(
136140
mock_authorization.exchange_token.assert_called_once()
137141

138142
@pytest.mark.asyncio
143+
@pytest.mark.unit
139144
async def test_add_tool_servers_uses_provided_token(
140145
self, mock_agent, mock_authorization, mock_turn_context
141146
):
@@ -178,6 +183,7 @@ async def test_add_tool_servers_uses_provided_token(
178183
mock_authorization.exchange_token.assert_not_called()
179184

180185
@pytest.mark.asyncio
186+
@pytest.mark.unit
181187
async def test_add_tool_servers_creates_mcp_toolsets(
182188
self, mock_agent, mock_authorization, mock_turn_context, mock_server_config
183189
):
@@ -227,6 +233,7 @@ async def test_add_tool_servers_creates_mcp_toolsets(
227233
assert mock_toolset in service._connected_servers
228234

229235
@pytest.mark.asyncio
236+
@pytest.mark.unit
230237
async def test_add_tool_servers_returns_new_agent(
231238
self, mock_agent, mock_authorization, mock_turn_context
232239
):
@@ -276,6 +283,7 @@ async def test_add_tool_servers_returns_new_agent(
276283
)
277284

278285
@pytest.mark.asyncio
286+
@pytest.mark.unit
279287
async def test_add_tool_servers_handles_toolset_creation_error(
280288
self, mock_agent, mock_authorization, mock_turn_context, mock_server_config
281289
):
@@ -329,6 +337,7 @@ class TestCleanup:
329337
"""Tests for cleanup method."""
330338

331339
@pytest.mark.asyncio
340+
@pytest.mark.unit
332341
async def test_cleanup_closes_connected_servers(self):
333342
"""Test that cleanup closes all connected servers."""
334343
with patch(
@@ -355,6 +364,7 @@ async def test_cleanup_closes_connected_servers(self):
355364
assert service._connected_servers == []
356365

357366
@pytest.mark.asyncio
367+
@pytest.mark.unit
358368
async def test_cleanup_handles_close_errors(self):
359369
"""Test that cleanup handles errors during close gracefully."""
360370
with patch(
@@ -377,6 +387,7 @@ async def test_cleanup_handles_close_errors(self):
377387
assert service._connected_servers == []
378388

379389
@pytest.mark.asyncio
390+
@pytest.mark.unit
380391
async def test_cleanup_handles_servers_without_close(self):
381392
"""Test that cleanup handles servers without close method."""
382393
with patch(

0 commit comments

Comments
 (0)