# Geometry/RF Engine Test Suite Plan This checklist tracks the work to build and verify a comprehensive RPC-focused test suite for `geomrf-engine`. ## 0) Deliverables - [x] Add a dedicated gRPC service test module that exercises all six RPCs. - [x] Validate success + error-path behavior for lifecycle and streaming RPCs. - [x] Produce an updated coverage report and capture gaps. - [x] Keep this checklist updated as tasks are completed. ## 1) Baseline and scope - [x] Confirm current tests/coverage baseline before adding new RPC tests. - [x] Confirm test scenario strategy (deterministic helper scenario; compatible with 027 overhead-pass style TLE + GS setup). ## 2) Test infrastructure - [x] Add an in-process gRPC test harness (ephemeral port, async channel/stub, clean teardown). - [x] Add shared helpers for creating/closing scenarios from tests. ## 3) RPC lifecycle tests - [x] `GetVersion` returns expected identity/schema metadata. - [x] `GetCapabilities` returns expected limits and feature flags. - [x] `CreateScenario` success path returns `scenario_ref`. - [x] `CreateScenario` invalid spec path returns `INVALID_ARGUMENT`. - [x] `CloseScenario` success path returns `ok=true`. - [x] `CloseScenario` unknown scenario path returns `NOT_FOUND`. ## 4) Streaming RPC tests - [x] `StreamLinkDeltas` success path returns ordered batches with snapshot metadata. - [x] `StreamLinkDeltas` unknown scenario path returns `NOT_FOUND`. - [x] `StreamLinkDeltas` closed scenario path returns `FAILED_PRECONDITION`. - [x] `StreamLinkDeltas` invalid time parameters return `INVALID_ARGUMENT`. - [x] `StreamEvents` success path returns well-formed events for the test scenario. - [x] `StreamEvents` filtered path validates event filtering behavior. - [x] `StreamEvents` unknown scenario path returns `NOT_FOUND`. - [x] `StreamEvents` closed scenario path returns `FAILED_PRECONDITION`. ## 5) Execution and coverage - [x] Run full test suite and ensure all tests pass. - [x] Run coverage scoped to `geomrf_engine`. - [x] Verify `server.py` and stream/event modules are covered by tests. - [x] Document final coverage numbers and remaining gaps. ## 6) Results summary - [x] Test count: `20 passed`. - [x] Coverage total (`geomrf_engine`): `85%` (`820` statements, `120` missed). - [x] Core RPC implementation coverage: `server.py` at `79%`, `streaming/events.py` at `96%`, `streaming/backpressure.py` at `80%`, `util/logging.py` at `92%`. - [x] Remaining notable gaps captured for follow-up: evaluator branch coverage (`56%`) and delta-threshold branch coverage (`71%`). ## 7) v1.1 follow-up (event alignment) - [ ] Add `StreamEvents` alignment tests for request `dt` semantics (`default_dt` fallback + invalid-range rejection). - [ ] Add selector-parity tests ensuring event selection mirrors `StreamLinkDeltas` selection. - [ ] Add assertions that every emitted `EngineEvent` carries `tick_index`. - [ ] Add cross-stream alignment test: same window/dt/selector for events+deltas yields consistent tick mapping. - [ ] Extend error-path coverage for new event request fields.