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
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
77 lines
4.1 KiB
Gherkin
77 lines
4.1 KiB
Gherkin
Feature: PlanApplyService coverage boost for checkpoint, rollback, and proxy paths
|
|
As a developer
|
|
I want to cover the uncovered lines in plan_apply_service.py
|
|
So that test coverage is comprehensive
|
|
|
|
# Targets uncovered lines:
|
|
# 674-688 _try_checkpoint with checkpoint_manager configured (success + exception)
|
|
# 697-707 _try_rollback with checkpoint_manager configured (success + exception + empty list)
|
|
# 777, 782, 787 _ApplyPhaseProxy constructor, sandbox_id, context
|
|
|
|
# -- _ApplyPhaseProxy ---------------------------------------------------
|
|
|
|
Scenario: ApplyPhaseProxy sets synthetic sandbox ID from plan ID
|
|
Given pacb an ApplyPhaseProxy with plan_id "01ABCDEF12345678XXXX"
|
|
Then pacb the proxy sandbox_id should be "apply-01ABCDEF12345678"
|
|
|
|
Scenario: ApplyPhaseProxy context returns None
|
|
Given pacb an ApplyPhaseProxy with plan_id "01ABCDEF12345678XXXX"
|
|
Then pacb the proxy context should be None
|
|
|
|
# -- _try_checkpoint success path ----------------------------------------
|
|
|
|
Scenario: _try_checkpoint creates checkpoint when manager is configured
|
|
Given pacb a service with a configured checkpoint manager
|
|
When pacb I call _try_checkpoint with plan_id "01CHKPTPLAN00000001" and phase "pre_apply"
|
|
Then pacb the checkpoint manager create_checkpoint should have been called
|
|
And pacb the checkpoint sandbox should have sandbox_id starting with "apply-"
|
|
|
|
Scenario: _try_checkpoint passes metadata to checkpoint manager
|
|
Given pacb a service with a configured checkpoint manager
|
|
When pacb I call _try_checkpoint with plan_id "01METAPLAN000000001" and phase "pre_apply" and metadata
|
|
Then pacb the checkpoint manager create_checkpoint should have received metadata
|
|
|
|
# -- _try_checkpoint exception path --------------------------------------
|
|
|
|
Scenario: _try_checkpoint swallows exception when checkpoint creation fails
|
|
Given pacb a service with a checkpoint manager that raises on create
|
|
When pacb I call _try_checkpoint with plan_id "01FAILCHKPT00000001" and phase "pre_apply"
|
|
Then pacb no exception should have been raised
|
|
And pacb the checkpoint manager create_checkpoint should have been called
|
|
|
|
# -- _try_rollback success path ------------------------------------------
|
|
|
|
Scenario: _try_rollback calls rollback_to with last checkpoint when checkpoints exist
|
|
Given pacb a service with a checkpoint manager that has existing checkpoints
|
|
When pacb I call _try_rollback with plan_id "01ROLLBACKPLAN00001"
|
|
Then pacb the checkpoint manager list_checkpoints should have been called
|
|
And pacb the checkpoint manager rollback_to should have been called with the last checkpoint
|
|
|
|
Scenario: _try_rollback does nothing when no checkpoints exist
|
|
Given pacb a service with a checkpoint manager that returns no checkpoints
|
|
When pacb I call _try_rollback with plan_id "01EMPTYCHKPT000001"
|
|
Then pacb the checkpoint manager list_checkpoints should have been called
|
|
And pacb the checkpoint manager rollback_to should not have been called
|
|
|
|
# -- _try_rollback exception path ----------------------------------------
|
|
|
|
Scenario: _try_rollback swallows exception when rollback fails
|
|
Given pacb a service with a checkpoint manager that raises on list
|
|
When pacb I call _try_rollback with plan_id "01ROLLBKFAIL000001"
|
|
Then pacb no exception should have been raised
|
|
|
|
# -- Integration: apply_with_validation_gate triggers checkpoint ---------
|
|
|
|
Scenario: apply_with_validation_gate creates checkpoint on success path
|
|
Given pacb a service with checkpoint manager and a plan with passing validations
|
|
When pacb I call apply_with_validation_gate
|
|
Then pacb the apply result outcome should be "applied"
|
|
And pacb the checkpoint manager create_checkpoint should have been called
|
|
|
|
Scenario: apply_with_validation_gate triggers rollback when complete_apply fails
|
|
Given pacb a service with checkpoint manager and complete_apply raises PlanError
|
|
When pacb I call apply_with_validation_gate
|
|
Then pacb the apply result outcome should be "applied"
|
|
And pacb the checkpoint manager create_checkpoint should have been called
|
|
And pacb the checkpoint manager list_checkpoints should have been called
|