You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "mengw15 (via GitHub)" <gi...@apache.org> on 2026/07/12 23:30:03 UTC

[I] add unit test coverage for agent-service workflow-crud-tools (add / modify / delete operator tools) [texera]

mengw15 opened a new issue, #6375:
URL: https://github.com/apache/texera/issues/6375

   ### Task Summary
   
   `agent-service/src/agent/tools/workflow-crud-tools.ts` (codecov ~22%) exports `createAddOperatorTool`, `createModifyOperatorTool`, `createDeleteOperatorTool` — factories returning AI-SDK tools whose `execute(args)` mutate an in-memory `WorkflowState`. Unit-testable with `bun test`: construct a real `WorkflowState`, build the tool, call `tool.execute(args)`, assert the state change + returned result. Only mock is `context.metadataStore.validateOperatorProperties` for the validation branches — no network. See `tools/tools-utility.spec.ts` for the pattern.
   
   ### Behavior to cover
   
   **createDeleteOperatorTool**
   - operator exists -> removes it (and connected links); returns `"Deleted operator: {operatorId}"`
   - operator absent -> `createErrorResult("Operator {operatorId} not found")`
   
   **createAddOperatorTool**
   - unknown `operatorType` (no schema entry) -> error
   - `operatorId` not matching `/^op\d+$/` -> error
   - `operatorId` already present -> error (`"... already exists. Use modifyOperator ..."`)
   - `properties` failing validation -> error carrying the validation messages
   - `inputOperatorIds` referencing a missing source operator -> error (`"Source operator ... not found"`)
   - target port index `NaN` / negative / `>= inputPorts.length` -> error
   - valid args -> adds operator + creates links; returns success
   
   **createModifyOperatorTool**
   - operator not found -> `createErrorResult("Operator {operatorId} not found ...")`
   - merged properties failing validation -> error via `formatValidationErrors(validation)`
   - valid args -> updates the operator's properties; returns success
   
   ### 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: notifications-unsubscribe@texera.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] add unit test coverage for agent-service workflow-crud-tools (add / modify / delete operator tools) [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6375:
URL: https://github.com/apache/texera/issues/6375#issuecomment-4953208502

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @mengw15!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] add unit test coverage for agent-service workflow-crud-tools (add / modify / delete operator tools) [texera]

Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 closed issue #6375: add unit test coverage for agent-service workflow-crud-tools (add / modify / delete operator tools)
URL: https://github.com/apache/texera/issues/6375


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org