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
74 lines
3.3 KiB
Gherkin
74 lines
3.3 KiB
Gherkin
Feature: LangChain chat provider coverage boost
|
|
As a maintainer focused on test coverage completeness
|
|
I want Behave scenarios that exercise remaining uncovered paths
|
|
So that langchain_chat_provider.py reaches full line coverage
|
|
|
|
Background:
|
|
Given a fresh LangChain chat provider with mocked dependencies
|
|
|
|
@coverage @langchain @token_cost
|
|
Scenario: Token cost resolution returns None when float conversion fails
|
|
When the usage tracker reports a non-numeric cost value
|
|
Then resolving token cost should return None
|
|
|
|
@coverage @langchain @extract_event
|
|
Scenario: Extract event returns unknown sentinel for empty event dict
|
|
When an empty event dictionary is passed to extract_event
|
|
Then the extracted node name should be "__unknown__" with an empty payload
|
|
|
|
@coverage @langchain @token_estimate
|
|
Scenario: Token estimation returns zero when the estimator callable raises
|
|
When the LLM token estimator raises an exception during estimation
|
|
Then the estimated token count should be zero
|
|
|
|
@coverage @langchain @token_estimate
|
|
Scenario: Token estimation returns zero when the result is not int-convertible
|
|
When the LLM token estimator returns a value that cannot be cast to int
|
|
Then the estimated token count should be zero
|
|
|
|
@coverage @langchain @error_extraction
|
|
Scenario: Error extraction returns None for an empty list
|
|
When the error value is an empty list
|
|
Then the extracted error message should be None
|
|
|
|
@coverage @langchain @error_extraction
|
|
Scenario: Error extraction returns None for an empty tuple
|
|
When the error value is an empty tuple
|
|
Then the extracted error message should be None
|
|
|
|
@coverage @langchain @error_extraction
|
|
Scenario: Error extraction returns None for an empty set
|
|
When the error value is an empty set
|
|
Then the extracted error message should be None
|
|
|
|
@coverage @langchain @error_extraction
|
|
Scenario: Error extraction returns None for a list of only None values
|
|
When the error value is a list containing only None entries
|
|
Then the extracted error message should be None
|
|
|
|
@coverage @langchain @callback_discovery
|
|
Scenario: OpenAI callback is discovered from langchain.callbacks module
|
|
When the langchain callbacks module exposes get_openai_callback
|
|
Then the callback discovery logic should bind the callable
|
|
|
|
@coverage @langchain @callback_discovery
|
|
Scenario: OpenAI callback discovery skips when attribute is not callable
|
|
When the langchain callbacks module exposes a non-callable get_openai_callback
|
|
Then the callback discovery logic should not bind any callable
|
|
|
|
@coverage @langchain @token_cost
|
|
Scenario: Token cost resolution returns None when cost attribute is missing
|
|
When the usage tracker has no total_cost attribute
|
|
Then resolving token cost should return None
|
|
|
|
@coverage @langchain @token_estimate
|
|
Scenario: Token estimation aggregates prompt and context content
|
|
When the LLM token estimator counts tokens for plan and multiple contexts
|
|
Then the estimated token count should reflect the combined prompt text
|
|
|
|
@coverage @langchain @generate @exception
|
|
Scenario: Generate changes returns error response when workflow raises
|
|
When generate_changes is called and the workflow raises an exception
|
|
Then the response should contain the exception message with zero changes
|
|
And progress should be reported as complete despite the failure
|