Files
cleveragents-core/features/acms_context_cli.feature
HAL9000 40e589eb55
CI / lint (pull_request) Successful in 39s
CI / push-validation (pull_request) Successful in 39s
CI / quality (pull_request) Successful in 55s
CI / helm (pull_request) Successful in 41s
CI / build (pull_request) Successful in 48s
CI / typecheck (pull_request) Successful in 1m13s
CI / security (pull_request) Successful in 1m18s
CI / unit_tests (pull_request) Successful in 4m43s
CI / docker (pull_request) Successful in 1m49s
CI / integration_tests (pull_request) Successful in 10m12s
CI / coverage (pull_request) Successful in 11m2s
CI / status-check (pull_request) Successful in 3s
test(e2e): add edge case scenarios for ACMS context CLI commands
Covers uncovered paths in acms_context.py:
- Empty view name rejection (context show error path)
- Clear without filters warning and auto-confirmation path

This improves code coverage by exercising the following functions:
- acms_context_show empty view validation branch (line 91-93)
- acms_context_clear no-filters warning with confirmation bypass (line 215-219)

Closes #9586
2026-06-03 11:24:21 -04:00

77 lines
3.2 KiB
Gherkin

Feature: ACMS Context CLI Commands
As a user
I want to view and manage ACMS context
So that I can inspect assembled context and remove stale entries
Background:
Given the ACMS service is initialized
And a test view "test_view" exists
Scenario: Show assembled context for a view
When I run "agents acms context show test_view"
Then the output should contain "Assembled Context for View: test_view"
And the output should contain "Total Tokens"
And the output should contain "Budget Utilization"
Scenario: Show context with no entries
Given the view "empty_view" has no context entries
When I run "agents acms context show empty_view"
Then the output should contain "No context found for view: empty_view"
Scenario: Clear context entries with confirmation
Given the view "test_view" has 5 context entries
When I run "agents acms context clear" and confirm
Then the output should contain "Removed 5 context entries"
Scenario: Clear context entries with --yes flag
Given the view "test_view" has 5 context entries
When I run "agents acms context clear --yes"
Then the output should contain "Removed 5 context entries"
And no confirmation prompt should be shown
Scenario: Clear context entries by path filter
Given the view "test_view" has 5 context entries
And 3 entries match the path pattern "src/*"
When I run "agents acms context clear --path src/* --yes"
Then the output should contain "context entries"
Scenario: Clear context entries by tag filter
Given the view "test_view" has 5 context entries
And 2 entries have the tag "deprecated"
When I run "agents acms context clear --tag deprecated --yes"
Then the output should contain "context entries"
Scenario: Clear context entries by tier filter
Given the view "test_view" has 5 context entries
And 2 entries are in tier "hot"
When I run "agents acms context clear --tier hot --yes"
Then the output should contain "context entries"
Scenario: Clear context with no matching entries
Given the view "test_view" has 5 context entries
When I run "agents acms context clear --path nonexistent/* --yes"
Then the output should contain "No context entries match"
Scenario: Show help for context show command
When I run "agents acms context show" with help flag
Then the output should contain "Display the assembled context"
And the output should contain "project view"
Scenario: Show help for context clear command
When I run "agents acms context clear" with help flag
Then the output should contain "Remove stale context entries"
And the output should contain "path"
And the output should contain "tag"
And the output should contain "tier"
Scenario: Show context rejects empty view name
When I run "agents acms context show" with empty view
Then the exit code should be non-zero
And the output should contain "View name must not be empty"
Scenario: Clear without filters shows warning
Given the view "test_view" has 5 context entries
When I run "agents acms context clear" and confirm with yes
Then the output should contain "No filters specified"
And the output should contain "Removed"