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

   ### Task Summary
   
   
`amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala`
 sits at **82.6% of lines** (42 missed of 299). A spec already exists — the 
deliverable is extending it, not adding a third.
   
   The residue is not scattered: it is entirely **permission-guard arms, 
exception paths, and one whole endpoint that has never been called** — 
`cloneWorkflow`. That makes it worth doing despite the modest line count, 
because permission guards are exactly the code where a silent regression 
matters.
   
   Everything it reaches is database-only, so `MockTexeraDB` suffices. 
`WorkflowVersionResource.insertVersion` is jOOQ plus Jackson `JsonDiff`; 
`HubResource.recordClone` is jOOQ. Nothing needs LakeFS, Docker, or an engine.
   
   Three things are worth knowing before writing assertions here, because each 
produces a test that looks stronger than it is:
   
   1. **`duplicateWorkflow`'s transactionality cannot be pinned from this 
spec.** The failure used to reach the catch — `assignNewOperatorIds` on a body 
with no operators array — is raised *before* `createWorkflow` inserts anything, 
so "no copy was created" holds whether or not the body runs in a transaction. 
Replacing `context.transaction { ... }` with a plain block leaves the suite 
green. Pinning the rollback needs a failure raised after the insert, and there 
is no seam for one.
   2. **`deleteWorkflow`'s post-transaction cleanup tail is enterable but not 
verifiable.** `LargeBinaryManager` is an `object` talking to S3 with no 
injectable seam, and the document cleanup needs real Iceberg-backed documents. 
Emptying the collected execution ids leaves the suite green. What *is* pinnable 
is that an undecodable URI is tolerated rather than aborting the delete — 
removing the `case NonFatal` arm of the outer catch does turn that test red.
   3. **In the write-access test, `getOwnerName` and the workflow list already 
hold before the call**, established by the seed and the access grant. 
`persistWorkflow`'s write branch touches only `WORKFLOW` and 
`WORKFLOW_VERSION`, so no mutation confined to it can move them. They are 
guards; the content and version-count assertions carry the pin.
   
   Note also that jacoco reports a wide line-versus-branch split on this file 
(branch coverage stays low even at 100% lines) because of the synthetic 
branches Scala generates; the line figure is the meaningful one here.
   
   ### 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]

Reply via email to