195fbac109
CI / lint (pull_request) Successful in 40s
CI / helm (pull_request) Successful in 38s
CI / build (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 1m0s
CI / typecheck (pull_request) Successful in 1m29s
CI / security (pull_request) Successful in 1m28s
CI / push-validation (pull_request) Successful in 20s
CI / unit_tests (pull_request) Successful in 5m8s
CI / docker (pull_request) Successful in 1m27s
CI / integration_tests (pull_request) Successful in 8m39s
CI / coverage (pull_request) Successful in 11m1s
CI / status-check (pull_request) Successful in 3s
Add domain-scenario Gherkin tags to all A2A, session, and CLI feature files (30 files) so tests can be filtered individually via behave. - 8 A2A feature files: @a2a tag - 7 session feature files: @session tag - 15 CLI feature files: @cli tag ISSUES CLOSED: #9124
91 lines
4.3 KiB
Gherkin
91 lines
4.3 KiB
Gherkin
@a2a
|
|
@mock_only
|
|
Feature: A2A SSE streaming for task updates and artifacts
|
|
As a CleverAgents developer
|
|
I want the A2A event system to support SSE streaming with JSON-RPC 2.0 compliance
|
|
So that clients can receive real-time task status and artifact updates in a standard format
|
|
|
|
Scenario: SSE event formatter produces valid text/event-stream output
|
|
Given an A2aEvent with type "TaskStatusUpdateEvent" and plan_id "plan-001"
|
|
When I format the event as SSE
|
|
Then the SSE output should contain "event: TaskStatusUpdateEvent"
|
|
And the SSE output should contain "id: "
|
|
And the SSE output should contain "data: "
|
|
And the SSE output should end with two newlines
|
|
|
|
Scenario: SSE keepalive produces a comment line
|
|
When I format a keepalive SSE message
|
|
Then the keepalive should start with ":"
|
|
|
|
Scenario: EventBusBridge translates plan status events
|
|
Given an A2aEventQueue for SSE testing
|
|
And a mock EventBus
|
|
And an EventBusBridge connecting bus to queue
|
|
When the bridge receives a PLAN_CREATED domain event
|
|
Then the queue should contain a TaskStatusUpdateEvent
|
|
|
|
Scenario: EventBusBridge translates artifact events
|
|
Given an A2aEventQueue for SSE testing
|
|
And a mock EventBus
|
|
And an EventBusBridge connecting bus to queue
|
|
When the bridge receives a CHECKPOINT_RESTORED domain event
|
|
Then the queue should contain a TaskArtifactUpdateEvent
|
|
|
|
Scenario: EventBusBridge handles closed queue gracefully
|
|
Given an A2aEventQueue for SSE testing
|
|
And a mock EventBus
|
|
And an EventBusBridge connecting bus to queue
|
|
When the queue is closed
|
|
And the bridge receives a PLAN_CREATED domain event
|
|
Then no error should be raised from the bridge
|
|
|
|
Scenario: TaskStatusUpdateEvent type constant is defined
|
|
Then the TASK_STATUS_UPDATE constant should equal "TaskStatusUpdateEvent"
|
|
|
|
Scenario: TaskArtifactUpdateEvent type constant is defined
|
|
Then the TASK_ARTIFACT_UPDATE constant should equal "TaskArtifactUpdateEvent"
|
|
|
|
Scenario: SseEventFormatter produces JSON-RPC 2.0 compliant data payload
|
|
Given an A2aEvent with type "TaskStatusUpdateEvent" and plan_id "plan-002"
|
|
When I format the event as SSE
|
|
Then the SSE data line should contain valid JSON
|
|
And the JSON should have key "jsonrpc" with value "2.0"
|
|
And the JSON should have key "method" with value "task/statusUpdate"
|
|
And the JSON should have a "params" object
|
|
And the JSON params should have key "taskId" with value "plan-002"
|
|
|
|
Scenario: SseEventFormatter produces JSON-RPC 2.0 for TaskArtifactUpdateEvent
|
|
Given an A2aEvent with type "TaskArtifactUpdateEvent" and plan_id "plan-003"
|
|
When I format the event as SSE
|
|
Then the SSE data line should contain valid JSON
|
|
And the JSON should have key "jsonrpc" with value "2.0"
|
|
And the JSON should have key "method" with value "task/artifactUpdate"
|
|
And the JSON should have a "params" object
|
|
And the JSON params should have key "taskId" with value "plan-003"
|
|
|
|
Scenario: SseEventFormatter includes event data fields in params
|
|
Given an A2aEvent with type "TaskStatusUpdateEvent" and plan_id "plan-004" and data {"state": "working", "progress": 0.5}
|
|
When I format the event as SSE
|
|
Then the SSE data line should contain valid JSON
|
|
And the JSON params should have key "state" with value "working"
|
|
And the JSON params should have key "progress" with numeric value 0.5
|
|
And the JSON params should have key "taskId" with value "plan-004"
|
|
|
|
Scenario: SseEventFormatter handles events without plan_id
|
|
Given an A2aEvent with type "TaskStatusUpdateEvent" and no plan_id
|
|
When I format the event as SSE
|
|
Then the SSE data line should contain valid JSON
|
|
And the JSON should have key "jsonrpc" with value "2.0"
|
|
And the JSON should have key "method" with value "task/statusUpdate"
|
|
And the JSON should have a "params" object
|
|
And the JSON params should not have key "taskId"
|
|
|
|
Scenario: SseEventFormatter excludes non-spec fields from data payload
|
|
Given an A2aEvent with type "TaskStatusUpdateEvent" and plan_id "plan-005"
|
|
When I format the event as SSE
|
|
Then the SSE data line should contain valid JSON
|
|
And the JSON should not have key "event_id"
|
|
And the JSON should not have key "event_type"
|
|
And the JSON should not have key "timestamp"
|
|
And the JSON should not have key "plan_id"
|