mengw15 opened a new pull request, #6380: URL: https://github.com/apache/texera/pull/6380
### What changes were proposed in this PR? Add unit test coverage for the operator CRUD tool factories in `agent-service/src/agent/tools/workflow-crud-tools.ts` — `createAddOperatorTool`, `createModifyOperatorTool`, and `createDeleteOperatorTool`. A `bun test` spec that builds each tool, calls `tool.execute(args)`, and asserts both the returned result string and the resulting `WorkflowState`. No production-code changes. The tools mutate an in-memory `WorkflowState`, so the spec uses a real `WorkflowState` and a real (in-memory, `loadFromMetadata`-seeded) `WorkflowSystemMetadata` — no network and no mocks; validation and predicate construction run through the genuine code paths. ### Any related issues, documentation, discussions? Closes #6375. ### How was this PR tested? ``` bun test src/agent/tools/workflow-crud-tools.spec.ts ``` 16 pass. `bun run typecheck` (tsc) and `bun run format:check` (prettier) are clean; the full `bun test` suite is 146 pass / 0 fail. I also verified the failure path (broke one assertion -> 1 fail, exit 1 -> reverted). Coverage: - **delete** — existing operator (removed, with connected links) / absent operator (error). - **add** — unknown operator type; missing metadata store; `operatorId` not matching `op<number>`; duplicate `operatorId`; properties failing validation; input port index out of range / negative; missing source operator; valid source operator; valid operator linked to an existing source. - **modify** — operator not found; merged properties failing validation; valid property + display-name update; `inputOperatorIds` replacing existing incoming links. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8 [1M context]) -- 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]
