d3b9b8c8b8
Implement A2A Agent Card discovery per ADR-047 and issue #867: - AgentCard Pydantic model (agent_card.py) with nested models for skills, capabilities, extensions, security schemes, and interfaces. - Factory function build_agent_card() enumerates supported operations from the facade and maps them to A2A skills (plan-lifecycle, registry-crud, context-mgmt, entity-sync, namespace-mgmt, health-diagnostics). - Version negotiation: supportedVersions and version fields from A2aVersion constants. - A2A conformance validation (validate_agent_card_conformance) checks required fields, version support, and structural integrity. - Updated ASGI app to build the Agent Card from the facade model instead of a raw dict, with conformance validation at startup. - Behave BDD tests: 34 scenarios covering model construction, field validation, conformance checks, serialization, endpoint responses, and skill enumeration from facade operations. - Robot Framework integration tests: 6 test cases for build, conformance, endpoint, serialization, skill enumeration, and version info. - Updated A2A package exports and CHANGELOG. ISSUES CLOSED: #867
62 lines
2.7 KiB
Plaintext
62 lines
2.7 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration tests for A2A Agent Card discovery
|
|
...
|
|
... Tests verify that the Agent Card model, factory, conformance
|
|
... validation, discovery endpoint, skill enumeration, and
|
|
... version negotiation all work end-to-end.
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER} ${CURDIR}/helper_agent_card.py
|
|
|
|
*** Test Cases ***
|
|
Build Agent Card From Facade
|
|
[Documentation] build_agent_card produces a valid card from a facade
|
|
${result}= Run Process ${PYTHON} ${HELPER} build-card cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} build-card-ok
|
|
|
|
Agent Card A2A Conformance Validation
|
|
[Documentation] Agent Card passes A2A specification conformance checks
|
|
${result}= Run Process ${PYTHON} ${HELPER} conformance cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} conformance-ok
|
|
|
|
Agent Card Discovery Endpoint
|
|
[Documentation] /.well-known/agent.json returns full Agent Card with skills
|
|
${result}= Run Process ${PYTHON} ${HELPER} endpoint cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} endpoint-ok
|
|
|
|
Agent Card JSON Serialization
|
|
[Documentation] Agent Card round-trips through JSON serialization
|
|
${result}= Run Process ${PYTHON} ${HELPER} serialization cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} serialization-ok
|
|
|
|
Agent Card Skill Enumeration
|
|
[Documentation] Skills are correctly enumerated from facade operations
|
|
${result}= Run Process ${PYTHON} ${HELPER} skill-enumeration cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} skill-enumeration-ok
|
|
|
|
Agent Card Version Negotiation Info
|
|
[Documentation] Agent Card includes correct version negotiation information
|
|
${result}= Run Process ${PYTHON} ${HELPER} version-info cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} version-info-ok
|