Files
cleveragents-core/robot/session_cli.robot
T
brent.edwards 0588495007
CI / lint (pull_request) Failing after 1s
CI / typecheck (pull_request) Failing after 1s
CI / security (pull_request) Failing after 1s
CI / quality (pull_request) Failing after 1s
CI / unit_tests (pull_request) Failing after 1s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 0s
CI / build (pull_request) Failing after 0s
CI / helm (pull_request) Failing after 1s
CI / push-validation (pull_request) Failing after 1s
CI / status-check (pull_request) Failing after 0s
fix(cli): fix broken merge state in session command per spec #1451
The PR 1482 merge of master into bugfix/session-export-format-flag left
multiple broken states:

1. delete(): Orphaned else block without matching if/elif — removed
   the orphaned structure that references deleted fmt/message_count vars.

2. export_session(): Multiple unbound variable references (json_data instead
   of data, fmt instead of output_format) and a call to deleted
   _render_export_panels function — fixed all references and removed the
   Rich panel rendering block since CLI export is JSON-only per spec §1986.

3. import_session(): References to deleted schema_version and actor_name
   variables in structured output envelope — replaced with data.get() calls.

4. _facade_dispatch(): Changed A2aRequest constructor from operation= to
   method= (matching the actual model field name) and response attributes
   from .status/.data to .error/.result (matching A2aResponse model).

5. Added --format flag to export_session() that explicitly rejects non-JSON
   data format values (md, xml, etc.) since CLI export is JSON-only per spec.
   Use TUI /session:export --format md for Markdown export instead.

6. Updated robot integration tests (helper_session_cli.py, session_cli.robot)
   to expect JSON output instead of Rich panels for file and stdout export.
2026-06-10 00:21:47 +00:00

90 lines
4.3 KiB
Plaintext

*** Settings ***
Documentation End-to-end smoke tests for Session CLI commands
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER} ${CURDIR}/helper_session_cli.py
*** Test Cases ***
Session Create Default
[Documentation] Verify that ``session create`` succeeds with defaults
${result}= Run Process ${PYTHON} ${HELPER} create-default cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-create-default-ok
Session Create With Actor
[Documentation] Verify that ``session create --actor`` binds an actor
${result}= Run Process ${PYTHON} ${HELPER} create-actor cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-create-actor-ok
Session List Empty
[Documentation] Verify that ``session list`` handles empty state
${result}= Run Process ${PYTHON} ${HELPER} list-empty cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-list-empty-ok
Session List Populated
[Documentation] Verify that ``session list`` shows sessions
${result}= Run Process ${PYTHON} ${HELPER} list-populated cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-list-populated-ok
Session Show Valid
[Documentation] Verify that ``session show`` displays details
${result}= Run Process ${PYTHON} ${HELPER} show-valid cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-show-valid-ok
Session Show Not Found
[Documentation] Verify that ``session show`` reports missing session
${result}= Run Process ${PYTHON} ${HELPER} show-not-found cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-show-not-found-ok
Session Delete With Yes
[Documentation] Verify that ``session delete --yes`` works
${result}= Run Process ${PYTHON} ${HELPER} delete-yes cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-delete-yes-ok
Session Export Import Roundtrip
[Documentation] Verify export/import round-trip
${result}= Run Process ${PYTHON} ${HELPER} export-import-roundtrip cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-export-import-roundtrip-ok
Session Import Rich Output Panels
[Documentation] Verify that ``session import`` renders Session Import, Validation, and Merge panels
${result}= Run Process ${PYTHON} ${HELPER} import-rich-panels cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-import-rich-panels-ok
Session Export Rich Panels
[Documentation] Verify that ``session export`` to file produces valid JSON output per spec §1986
${result}= Run Process ${PYTHON} ${HELPER} export-rich-panels cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-export-json-ok
Session Export Stdout Rich Panels
[Documentation] Verify that ``session export`` to stdout produces valid JSON output per spec §1986
${result}= Run Process ${PYTHON} ${HELPER} export-stdout-rich-panels cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-export-stdout-json-ok
Session Tell Appends Message
[Documentation] Verify that ``session tell`` appends a message
${result}= Run Process ${PYTHON} ${HELPER} tell-message cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} session-cli-tell-message-ok