Files
cleveractors-core/features/config_specific_coverage.feature
CoreRasurae 9753b31c7e
CI / quality (push) Successful in 36s
CI / lint (push) Successful in 38s
CI / typecheck (push) Successful in 49s
CI / security (push) Successful in 51s
CI / integration_tests (push) Successful in 55s
CI / unit_tests (push) Successful in 3m35s
CI / build (push) Successful in 33s
CI / coverage (push) Successful in 3m36s
CI / status-check (push) Successful in 3s
test: add coverage gap tests improving coverage from 81.4% to 96.90%
Add 13 BDD scenarios covering previously uncovered code paths:
- SAFE_BUILTINS validation (sandbox.py: 0% → 100%)
- ConfigurationError re-raise path (config.py: 99.3% → 100%)
- CLI hello/main functions (cli.py: 72.7% → 90.9%)
- GraphState message truncation (state.py: 98.7% → 100%)
- ProgressBarManager update/context rendering (progress.py: 0% → 87.7%)
- MessageRouter regex/exact/contains routing (message_router.py: 0% → 59.4%)
- RoutingAdapter parse_routing_command (routing_adapter.py)
- DynamicRouterNode pattern-based routing (dynamic_router.py)
- EnhancedTemplateRegistry unknown template type (enhanced_registry.py: 99.2%)
- CompositeAgent null-graph error path (composite.py: 97.8% → 98.6%)

Cover routing_adapter.py (17% → 100%): all GOTO/ROUTE patterns,
create_routing_node, create_conditional_router, dynamic config conversion.

Cover dynamic_router.py (21% → 87%): execute with empty/dict/string
messages, extract_message with colon parsing, config creation, graph
extension with edge generation.

Cover message_router.py (59% → 78%): regex, exact, contains, prefix,
suffix match types, invalid regex handling, non-string message, set_state.

Exercise Node._prepare_conversation_history with invalid configs,
_runtime error paths, _execute_message_router with rules,
_execute_agent with current_message and metadata propagation,
_execute_function with dynamic_router, and _execute_conditional
with content_contains/content_not_contains/content_starts_with
and custom condition types. Improves nodes.py from 71.3% to 72.5%.

Exercise PureGraphConfig, PureLangGraph init with dict/config,
RxPyLangGraphBridge registration/connection/lookup,
ReactiveStreamRouter operator creation and condition functions,
ReactiveConfigParser config/route/graph parsing,
ToolAgent tool execution with JSON, space-separated, single,
file_read, progress_bar invocations, and
ReactiveCleverAgentsApp init/dispose/visualization.
2026-06-02 20:02:01 +01:00

109 lines
5.5 KiB
Gherkin

Feature: Configuration File Loading Error Paths, Type Conversion, and Schema Validation
As a developer
I want configuration loading to handle None, non-dict, YAML errors, file not found, and to convert string types to bool/int/float
So that configuration parsing never crashes and produces typed values from string inputs
Background:
Given the configuration testing environment is set up
Scenario: Test file loading with None YAML content - line 69
Given I have a YAML file that loads as None
When I load the configuration files through ConfigurationManager
Then the None content should be skipped and processing continues
Scenario: Test file loading with non-dict YAML content - line 72
Given I have a YAML file with list content instead of dict
When I load the configuration files through ConfigurationManager
Then a ConfigurationError should be raised about YAML dictionary requirement
Scenario: Test YAML parsing error - lines 77-85
Given I have a YAML file with malformed syntax
When I load the configuration files through ConfigurationManager
Then a ConfigurationError should be raised about YAML parsing failure
Scenario: Test file not found error - lines 82-85
Given I have a configuration file path that does not exist
When I load the configuration files through ConfigurationManager
Then a ConfigurationError should be raised about file loading failure
Scenario: Test schema validation exception handling - lines 131-134
Given I have a configuration manager with schema validator that raises Exception
When I call validate method
Then a ConfigurationError should be raised about validation failure
Scenario: Test set method with empty path - line 175-176
Given I have a ConfigurationManager instance
When I call set method with empty path
Then a ConfigurationError should be raised about empty path
Scenario: Test set method with non-dict parent path - lines 182-183
Given I have a ConfigurationManager with string value in config
When I call set method to create nested path under string value
Then a ConfigurationError should be raised about parent not being dictionary
Scenario: Test set method with non-dict final parent - lines 187, 190-191
Given I have a ConfigurationManager with nested config
When I call set method where final parent is not dict
Then a ConfigurationError should be raised about final parent not being dictionary
Scenario: Test environment variable interpolation missing var - line 238-240
Given I have configuration with undefined environment variable
When I call interpolate_env_vars method
Then a ConfigurationError should be raised about variable not set
Scenario: Test interpolate_env_vars default value handling - lines 229-236
Given I have configuration with environment variables with different default types
When I call interpolate_env_vars method
Then boolean defaults should be processed as strings
And numeric defaults should be returned as strings
And string defaults should be returned unchanged
Scenario: Test environment variable interpolation with actual string replacement
Given the configuration testing environment is set up
Given I have configuration with environment variables that need string processing
When I call interpolate_env_vars method
Then environment variable replacement should work correctly
Scenario: Test ConfigurationError is re-raised during file loading - lines 82-83
Given the configuration testing environment is set up
Given I have a configuration manager that throws ConfigurationError during loading
When I attempt to load configuration files
Then the original ConfigurationError should be re-raised
Scenario: Test Exception converted to ConfigurationError during file loading - lines 84-87
Given the configuration testing environment is set up
Given I have a configuration manager that throws generic Exception during loading
When I attempt to load configuration files
Then a ConfigurationError should be raised about file loading failure
Scenario: Test string type conversion boolean - line 247
Given I have string configuration values that are boolean
When I call interpolate_env_vars method
Then boolean strings should be converted to boolean values
Scenario: Test string type conversion integer - line 249
Given I have string configuration values that are integers
When I call interpolate_env_vars method
Then integer strings should be converted to integer values
Scenario: Test string type conversion float - line 251
Given I have string configuration values that are floats
When I call interpolate_env_vars method
Then float strings should be converted to float values
Scenario: Test schema validation non-dict agent config - line 312
Given I have configuration with agent config as non-dict value
When I call schema validator validate method
Then a ConfigurationError should be raised about agent config dictionary
Scenario: Test schema validation non-dict agent entry - line 325
Given I have configuration with agent entry as non-dict value
When I call schema validator validate method
Then a ConfigurationError should be raised about agent configuration dictionary
Scenario: Test additional coverage scenarios for 90%+ coverage
Given the configuration testing environment is set up
Given I have comprehensive test scenarios for remaining lines
When I execute all remaining coverage tests
Then config coverage should reach 90% or higher