Add reviewer, artifact store, and paginated queries
This commit is contained in:
@@ -10,6 +10,7 @@ from ai_orchestrator.application.services.workers import (
|
||||
WorkerService,
|
||||
)
|
||||
from ai_orchestrator.infrastructure.storage.memory import (
|
||||
InMemoryArtifactStore,
|
||||
InMemoryEventStore,
|
||||
InMemoryInvocationStore,
|
||||
InMemoryWorkerRepository,
|
||||
@@ -22,22 +23,25 @@ def _build_gateway() -> tuple[
|
||||
InMemoryWorkerRepository,
|
||||
InMemoryEventStore,
|
||||
InMemoryInvocationStore,
|
||||
InMemoryArtifactStore,
|
||||
]:
|
||||
worker_repository = InMemoryWorkerRepository()
|
||||
event_store = InMemoryEventStore()
|
||||
invocation_store = InMemoryInvocationStore()
|
||||
artifact_store = InMemoryArtifactStore()
|
||||
service = WorkerService(worker_repository=worker_repository, event_store=event_store)
|
||||
gateway = CapabilityAwareWorkerGateway(
|
||||
worker_repository=worker_repository,
|
||||
event_store=event_store,
|
||||
invocation_store=invocation_store,
|
||||
artifact_store=artifact_store,
|
||||
connection_manager=InMemoryWorkerConnectionManager(),
|
||||
)
|
||||
return gateway, service, worker_repository, event_store, invocation_store
|
||||
return gateway, service, worker_repository, event_store, invocation_store, artifact_store
|
||||
|
||||
|
||||
def test_worker_gateway_dispatches_and_completes_command() -> None:
|
||||
gateway, service, worker_repository, event_store, invocation_store = _build_gateway()
|
||||
gateway, service, worker_repository, event_store, invocation_store, _ = _build_gateway()
|
||||
response = service.register(
|
||||
RegisterWorkerRequest(
|
||||
worker_id="worker_home_pc",
|
||||
@@ -80,7 +84,7 @@ def test_worker_gateway_dispatches_and_completes_command() -> None:
|
||||
|
||||
|
||||
def test_worker_gateway_rejects_unsupported_capability() -> None:
|
||||
gateway, service, _, _, _ = _build_gateway()
|
||||
gateway, service, _, _, _, _ = _build_gateway()
|
||||
response = service.register(
|
||||
RegisterWorkerRequest(
|
||||
worker_id="worker_home_pc",
|
||||
@@ -103,7 +107,7 @@ def test_worker_gateway_rejects_unsupported_capability() -> None:
|
||||
|
||||
|
||||
def test_worker_service_heartbeat_and_stale_tracking() -> None:
|
||||
_, service, worker_repository, event_store, _ = _build_gateway()
|
||||
_, service, worker_repository, event_store, _, _ = _build_gateway()
|
||||
response = service.register(
|
||||
RegisterWorkerRequest(
|
||||
worker_id="worker_home_pc",
|
||||
|
||||
Reference in New Issue
Block a user