forked from cleveragents/cleveragents-core
f2be43dcc2
Centralize CLI output through shared renderers module with get_console() and get_err_console() accessors. Introduce ColumnSpec-based table rendering for plan list, resource list, and actor list commands. Add _FORMAT_HELP constant and fmt= parameter threading for consistent format handling. Includes Behave BDD tests for format output validation, Robot Framework integration tests for CLI formatting consistency, and CHANGELOG entry. ISSUES CLOSED: #210
48 lines
2.4 KiB
Plaintext
48 lines
2.4 KiB
Plaintext
*** Settings ***
|
|
Documentation Smoke tests for CLI --format flag parity (json/yaml/plain/table/rich)
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER} ${CURDIR}/helper_cli_formats.py
|
|
|
|
*** Test Cases ***
|
|
Action List Format JSON Outputs Valid JSON
|
|
[Documentation] Verify that ``action list --format json`` emits parseable JSON
|
|
${result}= Run Process ${PYTHON} ${HELPER} action-list-json cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} cli-formats-action-list-json-ok
|
|
|
|
Action Show Format YAML Outputs Valid YAML
|
|
[Documentation] Verify that ``action show --format yaml`` emits parseable YAML
|
|
${result}= Run Process ${PYTHON} ${HELPER} action-show-yaml cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} cli-formats-action-show-yaml-ok
|
|
|
|
Plan Lifecycle List Format JSON Outputs Valid JSON
|
|
[Documentation] Verify that ``plan lifecycle-list --format json`` emits JSON
|
|
${result}= Run Process ${PYTHON} ${HELPER} plan-list-json cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} cli-formats-plan-list-json-ok
|
|
|
|
Plan Status Format Plain Outputs Key-Value Pairs
|
|
[Documentation] Verify that ``plan status <id> --format plain`` emits plain text
|
|
${result}= Run Process ${PYTHON} ${HELPER} plan-status-plain cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} cli-formats-plan-status-plain-ok
|
|
|
|
Renderer Detail JSON Produces Valid JSON
|
|
[Documentation] Verify render_detail produces parseable JSON output
|
|
${result}= Run Process ${PYTHON} ${HELPER} renderer-detail-json cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} cli-formats-renderer-detail-json-ok
|
|
|
|
Renderer List Plain Uses ASCII Only
|
|
[Documentation] Verify render_list plain output is ASCII-safe
|
|
${result}= Run Process ${PYTHON} ${HELPER} renderer-list-plain-ascii cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} cli-formats-renderer-list-plain-ascii-ok
|