Files
cleveragents-core/features/cleanup_cli_uncovered_branches.feature
freemo ca1c341b18
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 28s
CI / typecheck (pull_request) Successful in 32s
CI / integration_tests (pull_request) Successful in 2m39s
CI / unit_tests (pull_request) Successful in 5m22s
CI / docker (pull_request) Successful in 38s
CI / benchmark-regression (pull_request) Successful in 17m47s
CI / coverage (pull_request) Successful in 19m6s
CI / lint (push) Successful in 14s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 20s
CI / security (push) Successful in 29s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 3m23s
CI / unit_tests (push) Successful in 9m12s
CI / docker (push) Successful in 16s
CI / benchmark-publish (push) Successful in 10m4s
CI / coverage (push) Successful in 19m27s
Tests: Significantly improved coverage of the unit tests
2026-02-22 00:43:08 -05:00

43 lines
2.1 KiB
Gherkin

Feature: Cleanup CLI uncovered branches
Cover missed lines and branches in cleveragents.cli.commands.cleanup:
L49-50 (inner OSError in _detect_active_plan_ids),
L52-58 (outer OSError),
L8794 (scan with no stale items),
L128-131 (purge dry-run with stale items),
L139143 (purge confirmation prompt accepted).
Scenario: scan reports no stale resources when report is empty
Given cleanup cli branch mock service returns empty report
When cleanup cli branch I invoke scan via main app
Then cleanup cli branch exit code is 0
And cleanup cli branch output contains "No stale resources found"
Scenario: purge dry-run lists stale items when present
Given cleanup cli branch mock service returns report with stale items
When cleanup cli branch I invoke purge dry-run via main app
Then cleanup cli branch exit code is 0
And cleanup cli branch output contains "Would clean:"
And cleanup cli branch output contains "/tmp/fake-sandbox"
Scenario: detect active plan ids handles inner OSError on stat
Given cleanup cli branch a service whose sandbox dir stat raises OSError
When cleanup cli branch I call detect active plan ids
Then cleanup cli branch the result is an empty frozenset
Scenario: detect active plan ids handles outer OSError from get sandbox dirs
Given cleanup cli branch a service whose get sandbox dirs raises OSError
When cleanup cli branch I call detect active plan ids
Then cleanup cli branch the result is an empty frozenset
And cleanup cli branch a warning was printed about active plans
Scenario: detect active plan ids returns empty frozenset for empty dir list
Given cleanup cli branch a service with no sandbox dirs
When cleanup cli branch I call detect active plan ids
Then cleanup cli branch the result is an empty frozenset
Scenario: purge with confirmation prompt accepted proceeds to purge
Given cleanup cli branch mock service returns purge report
When cleanup cli branch I invoke purge with confirmation y via main app
Then cleanup cli branch exit code is 0
And cleanup cli branch output contains "Cleanup Complete"