Files
cleveragents-core/robot/server_app.robot
freemo e13308b322 feat(server): integrate LangGraph Platform with RemoteGraph for server execution
Implement the server application module (ADR-048) with:

- FastAPI application factory (app.py) exposing the A2A JSON-RPC 2.0
  endpoint as the sole client-facing interface. Routes: POST /a2a
  (JSON-RPC dispatch), GET /.well-known/agent.json (Agent Card), and
  GET /health (container orchestration).

- RemoteGraph adapter (remote_graph.py) for invoking actor graphs
  via LangGraph Platform. Each actor graph deploys as a separate
  RemoteGraph enabling independent scaling. Includes health tracking,
  invocation counting, and a RemoteGraphRegistry for managing
  multiple graph deployments.

- Database configuration (database.py) supporting PostgreSQL for
  production and SQLite for development. Config-driven via
  CLEVERAGENTS_DATABASE_URL and CLEVERAGENTS_SERVER_ENV environment
  variables with validated Pydantic settings model.

- Docker deployment (docker/Dockerfile + docker-compose.yml) with
  multi-stage build, non-root user, health checks, and PostgreSQL
  service.

- FastAPI dependency added to pyproject.toml.

- 26 Behave BDD scenarios covering app factory, A2A dispatch, Agent
  Card, health endpoint, RemoteGraph config/adapter/registry, and
  database configuration.

- 10 Robot Framework integration tests with helper script verifying
  end-to-end server functionality.

ISSUES CLOSED: #693
2026-03-12 03:05:00 +00:00

90 lines
3.9 KiB
Plaintext

*** Settings ***
Documentation Integration tests for server application with LangGraph Platform RemoteGraph
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER} ${CURDIR}/helper_server_app.py
*** Test Cases ***
Server Application Factory
[Documentation] Verify create_app returns a FastAPI application with required routes
${result}= Run Process ${PYTHON} ${HELPER} app-factory cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-app-factory-ok
A2A Endpoint Dispatch
[Documentation] Verify the A2A JSON-RPC endpoint dispatches message/send
${result}= Run Process ${PYTHON} ${HELPER} a2a-dispatch cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-a2a-dispatch-ok
A2A Parse Error
[Documentation] Verify A2A endpoint returns parse error for invalid JSON
${result}= Run Process ${PYTHON} ${HELPER} a2a-parse-error cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-a2a-parse-error-ok
Agent Card Endpoint
[Documentation] Verify agent card endpoint returns capability advertisement
${result}= Run Process ${PYTHON} ${HELPER} agent-card cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-agent-card-ok
Health Endpoint
[Documentation] Verify health endpoint returns server status
${result}= Run Process ${PYTHON} ${HELPER} health cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-health-ok
RemoteGraph Config Validation
[Documentation] Verify RemoteGraphConfig validates inputs
${result}= Run Process ${PYTHON} ${HELPER} remote-config cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-remote-config-ok
RemoteGraph Adapter
[Documentation] Verify RemoteGraphAdapter invocation and health tracking
${result}= Run Process ${PYTHON} ${HELPER} remote-adapter cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-remote-adapter-ok
RemoteGraph Registry
[Documentation] Verify RemoteGraphRegistry manages adapters
${result}= Run Process ${PYTHON} ${HELPER} remote-registry cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-remote-registry-ok
Database Config
[Documentation] Verify DatabaseConfig validates connection strings
${result}= Run Process ${PYTHON} ${HELPER} database-config cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-database-config-ok
Database Engine Creation
[Documentation] Verify SQLAlchemy engine creation from config
${result}= Run Process ${PYTHON} ${HELPER} database-engine cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} server-database-engine-ok