Files
cleveragents-core/features/system_cli_coverage_boost.feature

55 lines
2.8 KiB
Gherkin

Feature: System CLI coverage boost — uncovered branches in system.py
As a developer
I want to exercise the remaining uncovered code paths in system.py
So that all diagnostic checks have thorough test coverage
# _check_file_permissions: writable but not readable (line 344)
Scenario: File permissions check with writable but not readable data dir
Given the system coverage boost module is loaded
When I call check_file_permissions with writable-only data dir
Then the coverage boost result status should be "warn"
And the coverage boost result details should be "data dir w"
# ── _check_stale_locks: locks table exists, zero stale locks (lines 367-376) ──
Scenario: Stale locks check finds zero stale locks
Given the system coverage boost module is loaded
When I call check_stale_locks with locks table present and zero stale locks
Then the coverage boost result status should be "ok"
And the coverage boost result details should be "0 stale locks"
# ── _check_stale_locks: locks table exists, nonzero stale locks (lines 378-382) ──
Scenario: Stale locks check finds stale locks
Given the system coverage boost module is loaded
When I call check_stale_locks with locks table present and 3 stale locks
Then the coverage boost result status should be "warn"
And the coverage boost result details should contain "3 stale lock(s) found"
And the coverage boost result should have recommendation "Run lock cleanup or restart the service"
# ── _check_stale_locks: exception path (lines 384-388) ──
Scenario: Stale locks check handles unexpected exception
Given the system coverage boost module is loaded
When I call check_stale_locks and the database connection raises an exception
Then the coverage boost result status should be "warn"
And the coverage boost result details should be "unable to check"
# ── _check_async_worker_health: async enabled (lines 405-410) ──
Scenario: Async worker health check with async enabled
Given the system coverage boost module is loaded
When I call check_async_worker_health with async enabled and max_workers 4 and poll_interval 5
Then the coverage boost result status should be "ok"
And the coverage boost result details should contain "enabled, max_workers=4"
And the coverage boost result details should contain "poll_interval=5s"
# ── _check_async_worker_health: exception path (lines 413-417) ──
Scenario: Async worker health check handles unexpected exception
Given the system coverage boost module is loaded
When I call check_async_worker_health and get_settings raises an exception
Then the coverage boost result status should be "warn"
And the coverage boost result details should be "unable to check"