mengw15 opened a new issue, #7158: URL: https://github.com/apache/texera/issues/7158
### Task Summary `WorkflowState` (`agent-service/src/agent/workflow-state.ts`, codecov ~53%, 161 uncovered lines) is the agent's in-memory workflow model — pure state, no LLM/HTTP. Its spec exists but is thin (13 tests for 33 methods). Extend `workflow-state.spec.ts` to cover the remaining methods. `bun test`. ### Behavior to add The uncovered surface (from line-level coverage) is concentrated in these pure methods — cover them by seeding a small workflow (operators + links) and asserting: - **`toLogicalPlan(targetOperatorId?)`** (lines 418-452, the largest gap) — build a `WorkflowState` with a few operators + links, assert the produced `LogicalPlan` (operators, links, and the port wiring); cover both the whole-graph call and the `targetOperatorId` sub-plan. - **`getFrontierOperators(depth)` / `getSubDAG(targetOperatorId)`** (the traversal at 270-333) — seed a multi-hop DAG and assert the frontier operator ids at a given depth and the sub-DAG (operators + links) reachable from a target. - **Validation state**: `setValidationError` / `clearValidationError` / `setAllValidationErrors` / `getValidationOutput` / `updateWorkflowEmptyState` / `emitValidationChanged` / `getValidationChangedStream` — assert an error is stored/cleared, the aggregated `ValidationOutput`, the empty-state flag, and that the change stream emits on mutation. - **`updateOperatorInputPorts(operatorId, numInputPorts)`** (173-192) — assert ports are added/removed and links to removed ports are pruned. - **`setWorkflowContent` / `getWorkflowContent`** (395-399) — round-trip the content. All are deterministic in-memory operations; no mocking of external services needed. For the stream assertions, subscribe before mutating and assert the emitted value synchronously. ### Task Type - [ ] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [x] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
