-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
Milestone
Description
Overview
Migrate SDK interface tests to tests_v2/ with improved fixtures and patterns.
Scope
- Migrate
tests/test_sdk.py→tests_v2/unit/test_sdk.py - Use new fixtures (clean_tool_registry, mock_llm)
- Remove anti-patterns (manual
_TOOL_REGISTRY.clear()) - One test class at a time, verify each
Migration Process
CRITICAL: Follow 5-step process for each test class:
- Copy test class to
tests_v2/unit/test_sdk.py - Update to use new fixtures (remove anti-patterns)
- Run the new test:
pytest tests_v2/unit/test_sdk.py::TestClassName -v - Verify it tests the same behavior
- Continue to next test class
NEVER migrate multiple tests at once.
Test Classes to Migrate
From tests/test_sdk.py (1707 lines, 35+ test classes):
- Core interfaces (Agent, MCPAgent, tool decorator)
- SDK modules (ChatSDK, RAGSDK, LLM clients)
- Database mixins
- Utility classes
Anti-Patterns to Fix
- Remove manual
_TOOL_REGISTRY.clear()calls → useclean_tool_registryfixture - Remove hardcoded LLM responses → use
mock_llmfixture - Fix any hardcoded ports → use
free_portfixture
Acceptance Criteria
- All test classes from
test_sdk.pymigrated totests_v2/unit/test_sdk.py - All anti-patterns removed
- All tests pass:
pytest tests_v2/unit/test_sdk.py -v - Existing tests unchanged:
pytest tests/test_sdk.py -vstill passes - Test count verified: same number of tests in new version
Parent Issue
Part of #209 - Test Suite Overhaul Epic
Dependencies
Requires #239 (tests_v2 foundation) to be completed first.
Reactions are currently unavailable