Files
cleveragents-core/features/plan_execution_context_coverage_boost.feature
CoreRasurae 8548644819
CI / push-validation (pull_request) Successful in 1m1s
CI / helm (pull_request) Successful in 1m12s
CI / lint (pull_request) Successful in 2m22s
CI / build (pull_request) Successful in 2m17s
CI / typecheck (pull_request) Successful in 3m2s
CI / security (pull_request) Successful in 3m1s
CI / quality (pull_request) Successful in 57s
CI / integration_tests (pull_request) Successful in 5m0s
CI / unit_tests (pull_request) Successful in 6m8s
CI / docker (pull_request) Successful in 1m30s
CI / coverage (pull_request) Successful in 11m51s
CI / status-check (pull_request) Successful in 6s
CI / push-validation (push) Successful in 31s
CI / helm (push) Successful in 37s
CI / build (push) Successful in 1m7s
CI / lint (push) Successful in 1m28s
CI / quality (push) Successful in 1m30s
CI / typecheck (push) Successful in 1m44s
CI / security (push) Successful in 1m49s
CI / benchmark-regression (push) Failing after 40s
CI / e2e_tests (push) Successful in 54s
CI / integration_tests (push) Successful in 3m33s
CI / unit_tests (push) Successful in 5m21s
CI / docker (push) Successful in 1m29s
CI / coverage (push) Successful in 11m6s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (push) Successful in 1h39m32s
fix(cli): wire SubplanExecutionService in _get_plan_executor() to enable child plan execution
Wire subplan_service from the DI container into _get_plan_executor() so
PlanExecutor can spawn child plans during the Execute phase.  When
SubplanService is available but SubplanExecutionService is not explicitly
injected, _execute_subplans() now lazily creates a SubplanExecutionService
on-the-fly using the parent plan's subplan_config and the new
_execute_child_plan callback.

- _get_plan_executor(): retrieve subplan_service from container, pass to
  PlanExecutor constructor
- _execute_subplans(): lazily build SubplanExecutionService when only
  SubplanService is wired (Forgejo #10268)
- _execute_child_plan(): new PlanExecutor method that runs a child plan's
  strategize + execute phases, registered as executor_fn callback

ISSUES CLOSED: #10268
2026-05-19 19:28:35 +01:00

69 lines
3.7 KiB
Gherkin

@coverage @context
Feature: PlanExecutionContext coverage boost
As a developer
I want complete coverage of PlanExecutionContext and RuntimeExecuteActor
So that all uncovered lines in plan_execution_context.py are exercised
Scenario: PlanExecutionContext rejects empty plan_id
Given a pec fresh context
When I pec construct PlanExecutionContext with empty plan_id
Then a pec ValidationError should be raised with "plan_id must not be empty"
Scenario: PlanExecutionContext properties return configured values
Given a pec PlanExecutionContext with all optional fields set
Then pec the automation_profile property should return the configured value
And pec the plan_env property should return the configured value
And pec the project_env property should return the configured value
And pec the project_resources property should return the configured dict
And pec the resource_bindings property should return the configured dict
And pec the changeset_store property should return the configured store
And pec the active_changeset_ids property should return a list
Scenario: record_change raises PlanError when no changeset is active
Given a pec PlanExecutionContext with a valid plan_id
When I pec call record_change without starting a changeset
Then a pec PlanError should be raised about no active changeset
Scenario: get_changeset returns None for unknown changeset
Given a pec PlanExecutionContext with a valid plan_id
When I pec call get_changeset with a nonexistent changeset_id
Then pec the result should be None
Scenario: summarize returns metadata for execution context
Given a pec PlanExecutionContext with a valid plan_id
When I pec call summarize on the execution context
Then pec the summary should contain plan_id and decision_root_id
And pec the summary should contain counts for resources and bindings
Scenario: RuntimeExecuteActor rejects None tool_runner
Given a pec valid PlanExecutionContext
When I pec construct RuntimeExecuteActor with None tool_runner
Then a pec ValidationError should be raised with "tool_runner must not be None"
Scenario: RuntimeExecuteActor rejects None execution_context
Given a pec mock ToolRunner
When I pec construct RuntimeExecuteActor with None execution_context
Then a pec ValidationError should be raised with "execution_context must not be None"
Scenario: RuntimeExecuteActor properties return configured values
Given a pec RuntimeExecuteActor with valid tool_runner and execution_context
Then pec the tool_runner property should return the configured ToolRunner
And pec the execution_context property should return the configured PlanExecutionContext
Scenario: RuntimeExecuteActor execute with stream callback produces events
Given a pec RuntimeExecuteActor with valid tool_runner and execution_context with sandbox_root
And a pec stream event collector
When I pec execute with decisions and stream callback
Then pec the stream events should include "runtime_execute_started"
And pec the stream events should include "runtime_execute_complete"
Scenario: RuntimeExecuteActor execute without stream callback still works
Given a pec RuntimeExecuteActor with valid tool_runner and execution_context
When I pec execute with decisions and no stream callback
Then pec the result should be a RuntimeExecuteResult with a valid changeset_id
Scenario: RuntimeExecuteActor execute with sandbox_root populates sandbox_refs
Given a pec RuntimeExecuteActor with valid tool_runner and execution_context with sandbox_root
When I pec execute with decisions and no stream callback
Then pec the result sandbox_refs should include the sandbox_root