Files
cleveragents-core/features/plan_generation_langgraph_coverage.feature
hurui200320 d25a060c58
CI / lint (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 1m2s
CI / push-validation (pull_request) Successful in 39s
CI / helm (pull_request) Successful in 43s
CI / typecheck (pull_request) Successful in 1m31s
CI / security (pull_request) Successful in 1m32s
CI / build (pull_request) Successful in 1m3s
CI / integration_tests (pull_request) Successful in 3m42s
CI / unit_tests (pull_request) Successful in 6m13s
CI / docker (pull_request) Successful in 2m2s
CI / coverage (pull_request) Successful in 11m15s
CI / status-check (pull_request) Successful in 3s
CI / build (push) Successful in 53s
CI / lint (push) Successful in 1m1s
CI / helm (push) Successful in 26s
CI / quality (push) Successful in 1m16s
CI / typecheck (push) Successful in 1m20s
CI / security (push) Successful in 1m37s
CI / benchmark-regression (push) Failing after 40s
CI / push-validation (push) Successful in 21s
CI / integration_tests (push) Successful in 3m17s
CI / unit_tests (push) Successful in 4m28s
CI / e2e_tests (push) Successful in 3m22s
CI / docker (push) Successful in 1m52s
CI / coverage (push) Successful in 12m50s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (push) Successful in 1h20m0s
Revert "feat(ci): implement TDD bug tag quality gate for bug fix PRs"
This reverts commit e8d2f76466.
2026-05-12 08:30:24 +00:00

124 lines
6.4 KiB
Gherkin

Feature: Plan Generation LangGraph Coverage
As a developer
I want test coverage for the new PlanGenerationGraph LangGraph workflow in cleveragents.agents.plan_generation
So that I can ensure the workflow executes correctly
Background:
Given the langgraph plan generation module is importable
Scenario: PlanGenerationGraph LangGraph can be instantiated with default LLM
When I create a langgraph PlanGenerationGraph with no LLM
Then the langgraph graph should be initialized successfully
And the langgraph graph should have a default FakeListLLM configured
And the langgraph graph should have max_retries set to 3
Scenario: PlanGenerationGraph LangGraph can be instantiated with custom max_retries
When I create a langgraph PlanGenerationGraph with max_retries of 5
Then the langgraph graph max_retries should be 5
Scenario: PlanGenerationGraph LangGraph creates prompt templates
When I create a langgraph PlanGenerationGraph with no LLM
Then the langgraph graph should have an analyze_prompt template
And the langgraph graph should have a generate_prompt template
And the langgraph graph should have a validate_prompt template
Scenario: PlanGenerationGraph LangGraph builds workflow with correct nodes
When I create a langgraph PlanGenerationGraph with no LLM
Then the langgraph workflow graph should contain node "load_context"
And the langgraph workflow graph should contain node "analyze_requirements"
And the langgraph workflow graph should contain node "generate_plan"
And the langgraph workflow graph should contain node "validate"
Scenario: Format context summary with no files returns appropriate message
Given I have a langgraph PlanGenerationGraph instance
When I format the langgraph context summary with no contexts
Then the langgraph summary should be "No context files provided"
Scenario: Format context summary with multiple files
Given I have a langgraph PlanGenerationGraph instance
When I format the langgraph context summary with 3 contexts
Then the langgraph summary should include all 3 file paths
Scenario: Format context summary limits to five files
Given I have a langgraph PlanGenerationGraph instance
When I format the langgraph context summary with 8 contexts
Then the langgraph summary should indicate "and 3 more files"
Scenario: Load context node initializes state
Given I have a langgraph PlanGenerationGraph instance
When I execute the langgraph load_context node
Then the langgraph node result should have retry_count set to 0
And the langgraph node result should have error set to None
And the langgraph node result should include context metadata defaults
Scenario: Load context node enriches context summary
Given I have a langgraph PlanGenerationGraph instance
When I execute the langgraph load_context node with sample contexts
Then the langgraph node result should include an analyzed context summary
And the langgraph node result should include context dependencies
Scenario: Should retry returns retry when validation fails and retries available
Given I have a langgraph PlanGenerationGraph instance with max_retries 3
When I check langgraph should_retry with FAIL validation and retry_count 0
Then the langgraph retry decision should be "retry"
Scenario: Should retry returns end when validation passes
Given I have a langgraph PlanGenerationGraph instance with max_retries 3
When I check langgraph should_retry with PASS validation and retry_count 0
Then the langgraph retry decision should be "end"
Scenario: Should retry returns end when max retries reached
Given I have a langgraph PlanGenerationGraph instance with max_retries 3
When I check langgraph should_retry with FAIL validation and retry_count 4
Then the langgraph retry decision should be "end"
Scenario: Should retry still retries when retry_count equals max_retries
Given I have a langgraph PlanGenerationGraph instance with max_retries 3
When I check langgraph should_retry with FAIL validation and retry_count 3
Then the langgraph retry decision should be "retry"
Scenario: Validate node increments retry_count in returned state
Given I have a langgraph PlanGenerationGraph instance
When I execute the langgraph validate node with no changes
Then the langgraph validation status should be "FAIL"
And the langgraph validate result should include retry_count incremented from 0 to 1
Scenario: Validate node fails when no changes provided
Given I have a langgraph PlanGenerationGraph instance
When I execute the langgraph validate node with no changes
Then the langgraph validation status should be "FAIL"
And the langgraph validation message should contain "No changes to validate"
Scenario: Generate plan handles missing requirements
Given I have a langgraph PlanGenerationGraph instance
When I execute the langgraph generate_plan node with no requirements
Then the langgraph generated_changes should be empty
And the langgraph error should contain "No requirements to generate from"
Scenario: Workflow invoke method returns complete state
Given I have a langgraph PlanGenerationGraph instance
And I have langgraph workflow inputs with project plan and contexts
When I invoke the langgraph workflow synchronously
Then the langgraph workflow result should contain all expected fields
Scenario: Workflow stream method yields events
Given I have a langgraph PlanGenerationGraph instance
And I have langgraph workflow inputs with project plan and contexts
When I stream the langgraph workflow execution
Then the langgraph stream should yield multiple events
Scenario: PlanGenerationGraph retries transient LLM failures
Given I have a langgraph PlanGenerationGraph instance
When I execute the langgraph analyze_requirements node with a flaky LLM that fails once
Then the langgraph analyze node should succeed after retry
Scenario: LangGraph graphs package exports workflows
Given the langgraph graphs package is importable
Then the langgraph graphs exports should include "PlanGenerationGraph"
And the langgraph graphs exports should include "ContextAnalysisAgent"
Scenario: Agents package exposes LangGraph workflows
Given the agents package is importable
Then the agents package exports should include "PlanGenerationGraph"
And the agents package exports should include "ContextAnalysisAgent"