Files
cleveragents-core/features/system_cli_coverage_boost.feature
freemo a808c395f9
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 50s
CI / unit_tests (pull_request) Successful in 2m46s
CI / integration_tests (pull_request) Successful in 3m16s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m6s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 18s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m52s
CI / integration_tests (push) Successful in 3m8s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m53s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 33m0s
test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
Add 53 new .feature files and corresponding step definition files targeting
uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts
in 7 pre-existing step files by disambiguating step text.

New tests cover: ACP clients/facade, actor CLI/config, application container,
ACMS service/strategies, async worker, automation profile CLI, autonomy
guardrail, bridge, change model, config CLI/service, context service,
cross-plan correction, database models, decision service, decomposition
clustering/service, discovery handler, langchain chat provider, langgraph
nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/
preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI,
provider registry, reactive application/route, repositories, resolver handler,
resource registry service, resume model, retry patterns, sandbox protocol,
server CLI, skill CLI/service, skills registry, subplan execution/service,
system CLI, UKO loader, UoW, and YAML template engine.

Closes #645
2026-03-09 13:01:58 -04:00

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"