Skip to content

[Testing] CLI Command Test Coverage + tests_v2 Foundation #239

@itomek-amd

Description

@itomek-amd

Overview

First phase of test suite overhaul: Create tests_v2/ directory structure with CLI command coverage.

Parent Issue

Scope

  • Create tests_v2/ directory structure
  • Create tests_v2/conftest.py with improved fixtures
  • Create tests_v2/cli/test_commands.py with parametrized tests
  • Does NOT modify existing tests/

Implementation

1. Create Directory Structure

tests_v2/
├── conftest.py
└── cli/
    └── test_commands.py

2. Fixtures in tests_v2/conftest.py

@pytest.fixture
def clean_tool_registry():
    """Isolate tool registry between tests."""
    from gaia.agents.base.tools import _TOOL_REGISTRY
    saved = _TOOL_REGISTRY.copy()
    _TOOL_REGISTRY.clear()
    yield _TOOL_REGISTRY
    _TOOL_REGISTRY.clear()
    _TOOL_REGISTRY.update(saved)

@pytest.fixture
def free_port():
    """Get a free port for testing."""
    import socket
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.bind(('', 0))
        return s.getsockname()[1]

@pytest.fixture
def mock_llm():
    """Provide MockLLMProvider for agent testing."""
    from gaia.testing import MockLLMProvider
    return MockLLMProvider()

3. CLI Commands to Test

  • gaia chat, talk, prompt, llm
  • gaia blender, jira, docker
  • gaia api, mcp, eval
  • gaia summarize, cache

Acceptance Criteria

  • tests_v2/ directory created
  • tests_v2/conftest.py with 3 fixtures (clean_tool_registry, free_port, mock_llm)
  • tests_v2/cli/test_commands.py with parametrized --help tests for all commands
  • Happy-path tests for critical commands (chat, api, mcp)
  • All tests pass: pytest tests_v2/ -v
  • Existing tests unchanged: pytest tests/ -v still passes

Metadata

Metadata

Labels

enhancementNew feature or requesttestsTest changes

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions