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/08/11 05:21:34 UTC
[I] cover remaining pure logic in three amber classes [texera]
mengw15 opened a new issue, #7537:
URL: https://github.com/apache/texera/issues/7537
### Task Summary
Three amber classes have small pure-logic gaps left over after earlier coverage passes (~32 uncovered lines total). **Goal: bring the listed logic to full coverage** — add the cases below and use the coverage report to catch anything remaining. `AnyFlatSpec` + `Matchers`; every target below is unit-testable with no live infra.
### Behavior to add
**WorkflowVersionResource** (`amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowVersionResource.scala`, ~88%, 12 lines)
- `jsonTreeIterator` (the version-diff tree walk) is the bulk of the gap — feed it a nested JSON node and assert the flattened path/value sequence it yields, covering the object arm, the array arm, and the leaf arm.
- The remaining lines are in the version-lookup path — cover retrieving a version id that does not exist alongside the happy path (the spec already has a `MockTexeraDB` setup to seed from).
**WorkflowEmailNotifier** (`amber/src/main/scala/org/apache/texera/web/service/WorkflowEmailNotifier.scala`, ~74%, 11 lines)
- `createEmailMessage` — assert the built `EmailMessage`'s subject/content for each workflow state it formats (the notifier is constructed with the workflow/user context, so this is pure string building).
- `sendStatusEmail` — drive it for a state that should notify and one that should not; assert the message is only built/dispatched in the first case. Spy the `GmailResource.sendEmail` boundary rather than sending — no Gmail API call.
- Cover the invalid-recipient arm (the notifier validates the address before dispatching).
**ResultExportService** (`amber/src/main/scala/org/apache/texera/web/service/ResultExportService.scala`, ~76%, 28 lines — scope to the pure part)
- `fileName` handling: the default when no name is supplied (`"download.dat"`) and the `Content-Disposition` header it produces for a supplied name, including a name needing quoting/escaping.
- `errorMessages` — assert the accumulated message text for a failed export.
- Out of scope: the `writer` / `streamingOutput` arms that stream bytes into storage (they need a live document sink) — leave those to the integration tier.
### 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] cover remaining pure logic in three amber classes [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 closed issue #7537: cover remaining pure logic in three amber classes
URL: https://github.com/apache/texera/issues/7537
--
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