mengw15 opened a new pull request, #7165:
URL: https://github.com/apache/texera/pull/7165

   ### What changes were proposed in this PR?
   
   Adds a spec for `AdminExecutionResource`
   
(`amber/src/main/scala/org/apache/texera/web/resource/dashboard/admin/execution/AdminExecutionResource.scala`),
   which had no test coverage. The resource is jOOQ-backed, so the spec runs 
against
   embedded Postgres via `MockTexeraDB` (the established unit pattern, mirroring
   `WorkflowExecutionsResourceSpec`). No production code was changed.
   
   8 tests:
   
   - `mapToName` / `mapToStatus` — the pure status-code lookups, covering every 
known
     code and the default (`"UNKNOWN"` / `-1`); no DB needed.
   - `getTotalWorkflows` — returns 0 with no executions, and counts distinct
     workflows (two executions on one workflow still count as one).
   - `listWorkflows` — seeds a user, workflow, version and executions, then 
asserts:
     the returned row's fields (name, owner, mapped status, execution name); the
     `access` flag derived from `WORKFLOW_USER_ACCESS` (true with a grant, false
     without); that only the latest execution per workflow is returned; that the
     status filter narrows the result; and that providing a sort field still 
returns
     the row.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7160
   
   ### How was this PR tested?
   
   Unit tests, run locally against embedded Postgres (`MockTexeraDB`). All 
pass, and
   the failure path was verified by breaking an assertion to confirm the suite 
goes
   red:
   
   ```
   sbt "WorkflowExecutionService/testOnly *AdminExecutionResourceSpec"
   # Tests: succeeded 8, failed 0
   sbt "WorkflowExecutionService/scalafmtCheck"      # clean
   sbt "WorkflowExecutionService/Test/scalafix --check"   # clean
   ```
   
   ### 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]

Reply via email to