Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/store/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import pytest
from opentelemetry.sdk.trace import ReadableSpan
from pytest import FixtureRequest

from agentlightning.store.base import LightningStore
from agentlightning.store.memory import InMemoryLightningStore

__all__ = [
Expand All @@ -20,6 +22,22 @@ def inmemory_store() -> InMemoryLightningStore:
return InMemoryLightningStore()


@pytest.fixture
def sql_store():
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sql_store fixture lacks a docstring explaining its purpose as a placeholder. Consider adding a docstring like \"\"\"Placeholder fixture for SQL store implementation. Returns None until SQL store is ready.\"\"\".

Suggested change
def sql_store():
def sql_store():
"""Placeholder fixture for SQL store implementation. Returns None until SQL store is ready."""

Copilot uses AI. Check for mistakes.
"""Placeholder fixture for SQL store implementation. Returns None until SQL store is ready."""
return None


# Uncomment this when sql store is ready
# @pytest.fixture(params=["inmemory_store", "sql_store"])
@pytest.fixture(params=["inmemory_store"])
def store_fixture(request: FixtureRequest) -> LightningStore:
"""Parameterized fixture that provides different store implementations for testing.
Currently supports InMemoryLightningStore, with SQL store support planned.
"""
return request.getfixturevalue(request.param)


@pytest.fixture
def mock_readable_span() -> ReadableSpan:
"""Create a mock ReadableSpan for testing."""
Expand Down
9 changes: 5 additions & 4 deletions tests/store/test_client_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from portpicker import pick_unused_port
from yarl import URL

from agentlightning.store.base import UNSET
from agentlightning.store.base import UNSET, LightningStore
from agentlightning.store.client_server import LightningStoreClient, LightningStoreServer
from agentlightning.store.memory import InMemoryLightningStore
from agentlightning.types import LLM, OtelResource, PromptTemplate, RolloutConfig, Span, TraceStatus
Expand Down Expand Up @@ -56,10 +56,11 @@ async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:


@pytest_asyncio.fixture
async def server_client() -> AsyncGenerator[Tuple[LightningStoreServer, LightningStoreClient], None]:
store = InMemoryLightningStore()
async def server_client(
store_fixture: LightningStore,
) -> AsyncGenerator[Tuple[LightningStoreServer, LightningStoreClient], None]:
port = pick_unused_port()
server = LightningStoreServer(store, "127.0.0.1", port)
server = LightningStoreServer(store_fixture, "127.0.0.1", port)
await server.start()
client = LightningStoreClient(server.endpoint)
try:
Expand Down
Loading