Files
cleveragents-core/features/materializers_coverage_r3.feature
T
freemo 31472b5413
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 21s
CI / helm (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 3m20s
CI / quality (pull_request) Successful in 3m43s
CI / typecheck (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m8s
CI / integration_tests (pull_request) Successful in 9m33s
CI / unit_tests (pull_request) Successful in 10m12s
CI / docker (pull_request) Successful in 1m28s
CI / coverage (pull_request) Successful in 12m18s
CI / e2e_tests (pull_request) Successful in 19m51s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 15s
CI / helm (push) Successful in 22s
CI / lint (push) Successful in 3m18s
CI / quality (push) Successful in 3m41s
CI / typecheck (push) Successful in 3m57s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 4m10s
CI / unit_tests (push) Failing after 6m58s
CI / docker (push) Has been skipped
CI / integration_tests (push) Successful in 9m15s
CI / coverage (push) Successful in 12m26s
CI / e2e_tests (push) Successful in 23m11s
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Successful in 28m31s
CI / benchmark-regression (pull_request) Successful in 54m53s
test(coverage): add Behave scenarios for 39 under-covered modules
Add Behave feature/step pairs that exercise uncovered branches across handlers, LSP, CLI, and service layers to reach the coverage gate.

ISSUES CLOSED: #1232
2026-03-31 21:47:12 +00:00

88 lines
4.5 KiB
Gherkin

Feature: Materializers coverage round 3
As a developer maintaining the output rendering framework
I want thorough test coverage on materializer strategies
So that edge-case code paths in live and accumulate strategies are verified
# ---------------------------------------------------------------
# Line 344: _BaseBufferStrategy.on_element_closed early return
# when event.final_state is None
# ---------------------------------------------------------------
Scenario: Buffer strategy ignores element closed with no final state
Given matcov3 a PlainMaterializer instance
And matcov3 the strategy has a registered handle "hdl-abc" at index 0
When matcov3 an ElementClosed event with handle "hdl-abc" and no final state is dispatched
Then matcov3 the plain strategy output is empty
# ---------------------------------------------------------------
# Line 473: _LiveMaterializationStrategy._render_element base class
# ---------------------------------------------------------------
Scenario: Live strategy base class render_element delegates to color renderer
Given matcov3 a raw LiveMaterializationStrategy instance
And matcov3 a StatusMessage element with message "live-base-test"
When matcov3 I call the live base class _render_element
Then matcov3 the rendered text contains "live-base-test"
# ---------------------------------------------------------------
# Lines 486-487: _LiveMaterializationStrategy.on_element_created
# with initial_state=None
# ---------------------------------------------------------------
Scenario: Live strategy handles element created with no initial state
Given matcov3 a raw LiveMaterializationStrategy instance
When matcov3 an ElementCreated event with no initial state is dispatched to the live strategy
Then matcov3 the live strategy has an empty rendered entry at the declaration index
And matcov3 the live strategy has height zero at the declaration index
# ---------------------------------------------------------------
# Line 495: _LiveMaterializationStrategy.on_element_updated
# with unknown handle_id (idx is None)
# ---------------------------------------------------------------
Scenario: Live strategy ignores update for unknown handle
Given matcov3 a raw LiveMaterializationStrategy instance
When matcov3 an ElementUpdated event for unknown handle "hdl-ghost" is dispatched to the live strategy
Then matcov3 the live strategy rendered dict is empty
# ---------------------------------------------------------------
# Line 497: _LiveMaterializationStrategy.on_element_updated
# for a frozen (closed) element
# ---------------------------------------------------------------
Scenario: Live strategy ignores update for a frozen element
Given matcov3 a raw LiveMaterializationStrategy instance
And matcov3 a live element "hdl-frozen" is created and then closed at index 5
When matcov3 an ElementUpdated event for handle "hdl-frozen" is dispatched to the live strategy
Then matcov3 no error is raised for the frozen update
# ---------------------------------------------------------------
# Line 509: _LiveMaterializationStrategy.on_element_closed
# with unknown handle_id
# ---------------------------------------------------------------
Scenario: Live strategy ignores close for unknown handle
Given matcov3 a raw LiveMaterializationStrategy instance
When matcov3 an ElementClosed event for unknown handle "hdl-unknown-live" is dispatched to the live strategy
Then matcov3 the live strategy closed indices set is empty
# ---------------------------------------------------------------
# Line 550: _LiveMaterializationStrategy._render_frame with
# empty dirty set
# ---------------------------------------------------------------
Scenario: Live strategy render frame returns early when dirty set is empty
Given matcov3 a raw LiveMaterializationStrategy instance
When matcov3 I call _render_frame on the live strategy with an empty dirty set
Then matcov3 the live strategy stream is still empty
# ---------------------------------------------------------------
# Line 610: _AccumulateStrategy.on_element_updated returns
# immediately
# ---------------------------------------------------------------
Scenario: Accumulate strategy on_element_updated returns immediately
Given matcov3 a JsonMaterializer instance
When matcov3 an ElementUpdated event is dispatched to the accumulate strategy
Then matcov3 no error is raised for the accumulate update