forked from cleveragents/cleveragents-core
a808c395f9
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
99 lines
4.6 KiB
Gherkin
99 lines
4.6 KiB
Gherkin
Feature: Sandbox protocol coverage boost
|
||
Exercise uncovered lines in infrastructure/sandbox/protocol.py including
|
||
SandboxStatus.assert_transition error path and Sandbox Protocol default stubs.
|
||
|
||
# ---------------------------------------------------------------
|
||
# SandboxStatus.assert_transition – invalid transition raises error
|
||
# Covers lines 121-123
|
||
# ---------------------------------------------------------------
|
||
|
||
Scenario: assert_transition raises SandboxStateError for invalid transition
|
||
Given spcb sandbox status "cleaned_up" and target status "active"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb a SandboxStateError should be raised
|
||
And spcb the error message should contain "cleaned_up -> active"
|
||
|
||
Scenario: assert_transition raises SandboxStateError for pending to committed
|
||
Given spcb sandbox status "pending" and target status "committed"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb a SandboxStateError should be raised
|
||
And spcb the error message should contain "pending -> committed"
|
||
|
||
Scenario: assert_transition raises SandboxStateError for committed to active
|
||
Given spcb sandbox status "committed" and target status "active"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb a SandboxStateError should be raised
|
||
And spcb the error message should contain "committed -> active"
|
||
|
||
Scenario: assert_transition succeeds for valid pending to created transition
|
||
Given spcb sandbox status "pending" and target status "created"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb no exception should be raised
|
||
|
||
# ---------------------------------------------------------------
|
||
# Sandbox Protocol default property/method stubs
|
||
# Covers lines 223, 228, 233, 248, 263, 278, 290, 301
|
||
# ---------------------------------------------------------------
|
||
|
||
Scenario: Protocol sandbox_id default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the sandbox_id property is accessed
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol status default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the status property is accessed
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol context default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the context property is accessed
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol create default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the create method is called with plan_id "test-plan"
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol get_path default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the get_path method is called with path "src/main.py"
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol commit default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the commit method is called with message "test commit"
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol rollback default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the rollback method is called
|
||
Then spcb the result should be None
|
||
|
||
Scenario: Protocol cleanup default stub returns None
|
||
Given spcb a bare Sandbox protocol subclass instance
|
||
When spcb the cleanup method is called
|
||
Then spcb the result should be None
|
||
|
||
# ---------------------------------------------------------------
|
||
# Additional assert_transition edge cases for branch coverage
|
||
# ---------------------------------------------------------------
|
||
|
||
Scenario: assert_transition raises for every terminal-state outbound attempt
|
||
Given spcb sandbox status "cleaned_up" and target status "pending"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb a SandboxStateError should be raised
|
||
And spcb the error message should contain "cleaned_up -> pending"
|
||
|
||
Scenario: assert_transition raises for errored to active
|
||
Given spcb sandbox status "errored" and target status "active"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb a SandboxStateError should be raised
|
||
And spcb the error message should contain "errored -> active"
|
||
|
||
Scenario: assert_transition raises for rolled_back to committed
|
||
Given spcb sandbox status "rolled_back" and target status "committed"
|
||
When spcb assert_transition is called with those statuses
|
||
Then spcb a SandboxStateError should be raised
|
||
And spcb the error message should contain "rolled_back -> committed"
|