c65a0726a8
- Rewrote production CLI to use real ContextTierService (get_scoped_view, get_all_fragments, evict_lru) instead of non-existent ACMSService - Removed unused imports (Path, Panel, ScopedView) from production code - Fixed all lint issues: trailing whitespace, import ordering, nested with statements - Replaced typer.Abort() with typer.Exit(code=1) for error exits - Added input validation for empty/whitespace view parameter - Fixed error handling to use str(e) instead of e.message - Added guards against negative budget values in _format_budget_utilization - Added warning when clearing context with no filters (clear ALL) - Removed module-level console side effect - Moved mocks to features/mocks/acms_context_mocks.py per CONTRIBUTING.md - Fixed test assertions to capture real CLI output (not placeholder) - Fixed duplicate step definitions (AmbiguousStep errors) - Fixed feature file step mismatch for tier count parameter - Added Robot Framework integration tests in robot/acms_context_cli.robot - Added performance benchmarks in benchmarks/acms_context_cli_bench.py - Updated CHANGELOG.md with ACMS context CLI feature entry - Updated CONTRIBUTORS.md with ACMS context CLI contribution ISSUES CLOSED: #9586
82 lines
3.8 KiB
Plaintext
82 lines
3.8 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration tests for ACMS context CLI commands (context show and context clear)
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment With Database Isolation
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER} ${CURDIR}/helper_acms_context_cli.py
|
|
|
|
*** Test Cases ***
|
|
Context Show Command Returns Assembled Context
|
|
[Documentation] Verify context show command returns assembled context data
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-show cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-show-ok
|
|
|
|
Context Show Command Handles Empty View
|
|
[Documentation] Verify context show command handles view with no entries
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-show-empty cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-show-empty-ok
|
|
|
|
Context Clear Command Removes Entries With Yes Flag
|
|
[Documentation] Verify context clear command removes entries when --yes flag is used
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-clear-yes cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-clear-yes-ok
|
|
|
|
Context Clear Command Filters By Path
|
|
[Documentation] Verify context clear command filters entries by path pattern
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-clear-path cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-clear-path-ok
|
|
|
|
Context Clear Command Filters By Tag
|
|
[Documentation] Verify context clear command filters entries by tag
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-clear-tag cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-clear-tag-ok
|
|
|
|
Context Clear Command Filters By Tier
|
|
[Documentation] Verify context clear command filters entries by tier
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-clear-tier cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-clear-tier-ok
|
|
|
|
Context Clear Command Handles No Matching Entries
|
|
[Documentation] Verify context clear command handles case with no matching entries
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-clear-no-match cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-clear-no-match-ok
|
|
|
|
Context Show Validates Empty View Name
|
|
[Documentation] Verify context show command rejects empty view name
|
|
${result}= Run Process ${PYTHON} ${HELPER} context-show-empty-view cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-context-show-empty-view-ok
|
|
|
|
Budget Utilization Formats Correctly
|
|
[Documentation] Verify budget utilization formatting helper
|
|
${result}= Run Process ${PYTHON} ${HELPER} budget-format cwd=${WORKSPACE}
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} acms-budget-format-ok
|