96 lines
4.3 KiB
Gherkin
96 lines
4.3 KiB
Gherkin
Feature: Route Module Comprehensive Coverage
|
|
As a developer
|
|
I want to thoroughly test the route module functionality
|
|
So that all code paths and edge cases are covered
|
|
|
|
Background:
|
|
Given the route system is available
|
|
|
|
Scenario: RouteConfig validation for graph routes without nodes
|
|
Given I create a RouteConfig with graph type but no nodes
|
|
When I validate the configuration
|
|
Then I should get a ConfigurationError about missing nodes
|
|
|
|
Scenario: RouteConfig to_stream_config conversion error
|
|
Given I create a RouteConfig with graph type
|
|
When I try to convert it to StreamConfig
|
|
Then I should get a ValueError about invalid conversion
|
|
|
|
Scenario: RouteConfig to_graph_config conversion error
|
|
Given I create a RouteConfig with stream type
|
|
When I try to convert it to GraphConfig
|
|
Then I should get a ValueError about invalid conversion
|
|
|
|
Scenario: RouteConfig from_stream_config class method
|
|
Given I have a valid StreamConfig
|
|
When I create a RouteConfig from the StreamConfig
|
|
Then the RouteConfig should have stream type
|
|
And it should preserve all stream configuration details
|
|
|
|
Scenario: RouteConfig from_graph_config class method
|
|
Given I have a valid GraphConfig with nodes and edges
|
|
When I create a RouteConfig from the GraphConfig
|
|
Then the RouteConfig should have graph type
|
|
And it should preserve all graph configuration details
|
|
And node configurations should be converted to dictionaries
|
|
And edge configurations should be converted to dictionaries
|
|
|
|
Scenario: RouteComplexityAnalyzer bridge type analysis
|
|
Given I have a RouteConfig with bridge type
|
|
When I analyze the route complexity
|
|
Then it should return bridge complexity analysis
|
|
And the complexity should be "bridge"
|
|
And the score should be 0
|
|
|
|
Scenario: Stream complexity analysis with various features
|
|
Given I have stream routes with different features
|
|
When I analyze each route complexity
|
|
Then routes with more operators should have higher complexity scores
|
|
And routes with routing connections should get additional score
|
|
And hot streams should get additional score
|
|
And the complexity classification should match the score ranges
|
|
|
|
Scenario: Graph complexity analysis with conditional edges
|
|
Given I have graph routes with conditional edges
|
|
When I analyze the graph complexity
|
|
Then conditional edges should increase the complexity score
|
|
And the features should include conditional edge information
|
|
And checkpointing should increase the score
|
|
And time travel should increase the score
|
|
|
|
Scenario: Stream complexity recommendation logic
|
|
Given I have streams with different complexity scores
|
|
When I get recommendations for each stream
|
|
Then simple streams should get simple transformation recommendation
|
|
And moderate streams should get multi-step processing recommendation
|
|
And complex streams should get graph consideration recommendation
|
|
|
|
Scenario: Graph complexity recommendation logic
|
|
Given I have graphs with different complexity scores
|
|
When I get recommendations for each graph
|
|
Then moderate graphs should get conditional logic recommendation
|
|
And complex graphs should get stateful workflow recommendation
|
|
And advanced graphs should get feature evaluation recommendation
|
|
|
|
Scenario: Route type suggestion based on requirements
|
|
Given I have different requirement scenarios
|
|
When I ask for route type suggestions
|
|
Then persistence requirements should suggest graph
|
|
And state with conditionals should suggest graph
|
|
And conditionals without continuous should suggest graph
|
|
And stateless continuous should suggest stream
|
|
And simple cases should default to stream
|
|
|
|
Scenario: RouteConfig post_init stream type defaulting
|
|
Given I create a stream RouteConfig without specifying stream_type
|
|
When the post_init validation runs
|
|
Then the stream_type should default to COLD
|
|
|
|
Scenario: RouteConfig to_graph_config with complex node types
|
|
Given I have a RouteConfig with various node types and configurations
|
|
When I convert it to GraphConfig
|
|
Then all node types should be properly converted
|
|
And all node properties should be preserved
|
|
And retry policies and timeouts should be included
|
|
And conditions and subgraphs should be handled
|
|
And node metadata should be preserved in conversion |