Skip to content

[Testing] Core SDK Tests Migration #241

@itomek-amd

Description

@itomek-amd

Overview

Migrate SDK interface tests to tests_v2/ with improved fixtures and patterns.

Scope

  • Migrate tests/test_sdk.pytests_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:

  1. Copy test class to tests_v2/unit/test_sdk.py
  2. Update to use new fixtures (remove anti-patterns)
  3. Run the new test: pytest tests_v2/unit/test_sdk.py::TestClassName -v
  4. Verify it tests the same behavior
  5. 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 → use clean_tool_registry fixture
  • Remove hardcoded LLM responses → use mock_llm fixture
  • Fix any hardcoded ports → use free_port fixture

Acceptance Criteria

  • All test classes from test_sdk.py migrated to tests_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 -v still 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.

Metadata

Metadata

Labels

enhancementNew feature or requesttestsTest changes

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions