Files
cleveragents-core/features/plan_apply_service_branch_coverage.feature
T
freemo 2eb31a598c
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 2m44s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 23s
CI / typecheck (push) Successful in 31s
CI / security (push) Successful in 32s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 3m25s
CI / unit_tests (pull_request) Successful in 13m3s
CI / docker (pull_request) Successful in 1m2s
CI / benchmark-publish (push) Successful in 16m35s
CI / benchmark-regression (pull_request) Successful in 22m21s
CI / unit_tests (push) Successful in 24m45s
CI / docker (push) Successful in 8s
CI / coverage (pull_request) Successful in 1h1m47s
CI / coverage (push) Successful in 1h11m37s
test(coverage): add Behave BDD tests for 8 under-covered modules
Added targeted Behave BDD feature files and step definitions to improve
unit test coverage for:

- decision_service.py: Full coverage of all 7 service methods (18 scenarios)
- plan_apply_service.py: Branch coverage for handle_merge_failure (2 scenarios)
- plan_executor.py: Edge cases for rollback, checkpoint, and parse_steps (15 scenarios)
- cli/commands/plan.py: Uncovered region lines 1950-2273 (23 scenarios)
- repositories.py: Remaining missed branches and lines (14 scenarios)
- sandbox/checkpoint.py: Full coverage of CheckpointManager (26 scenarios)
- langgraph/bridge.py: Remaining uncovered lines and branches (10 scenarios)
- cli/commands/config.py: Safety net to maintain 100% coverage (42 scenarios)

Total: 150 new scenarios, 596 steps, all passing.

Also fixed a step definition collision in plan_lifecycle_coverage by renaming
"the delete result should be false" to "the plan delete result should be false".

ISSUES CLOSED: #475
2026-03-01 03:09:51 +00:00

24 lines
1.3 KiB
Gherkin

Feature: PlanApplyService branch coverage for handle_merge_failure logger path
As a developer
I want to cover the missed branch at line 426432 in plan_apply_service.py
So that branch-rate reaches 1.0
# The missed branch is the exception-propagation path from the
# self._logger.error() call inside handle_merge_failure (line 426).
# When the logger raises, execution skips the ``return plan`` on line 431
# and exits the function via the exception (line 432).
Scenario: handle_merge_failure propagates exception when logger.error raises
Given pas_branch a service whose logger.error will raise RuntimeError
When pas_branch I call handle_merge_failure and capture any exception
Then pas_branch a RuntimeError should have been raised
And pas_branch the plan error_details should still contain merge_conflict
And pas_branch lifecycle _commit_plan should have been invoked before the error
And pas_branch lifecycle fail_apply should have been invoked before the error
Scenario: handle_merge_failure returns plan when logger.error succeeds
Given pas_branch a service whose logger.error will succeed normally
When pas_branch I call handle_merge_failure normally
Then pas_branch the returned plan should not be None
And pas_branch the service logger.error should have been called with merge failure details