Files
cleveragents-core/features/langchain_chat_provider_coverage_boost.feature
freemo 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
test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
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
2026-03-09 13:01:58 -04:00

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