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

   ### What changes were proposed in this PR?
   
   Adds a `MockTexeraDB`-backed spec for `HubResource` (previously ~0% 
coverage),
   following the sibling embedded-Postgres specs. Seeds an owner + a liker user 
and a
   public workflow (with ownership + access), mocks `HttpServletRequest`, and 
covers
   the non-LakeFS surface with 11 tests:
   
   - **Actions (object helpers):** `recordUserAction` writes a `user_action` 
row;
     `recordLikeAction` inserts a like the first time / removes it on unlike / 
returns
     `false` when already liked; `recordCloneAction` writes a clone row and an 
action
     row.
   - **Endpoints:** `postLike` / `postUnlike` / `isLiked` toggle the like; 
`getCount`
     counts public workflows; `postView` increments the view count (1 → 2) and 
records
     a view action; `getCounts` reports the like count; `getTops` lists the 
liked
     public entity under the `"like"` key; `userAccess` returns the granted 
user ids;
     `fetchDashboardWorkflowsByWids` returns the seeded workflow.
   
   All tests use `EntityType.Workflow` (the workflow tables), which keeps them 
off the
   LakeFS-backed dataset-size path. No production code was changed.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7225.
   
   ### How was this PR tested?
   
   `sbt "WorkflowExecutionService/testOnly *HubResourceSpec"` — 11 passed, run 
twice
   in full plus the `getTops` / `getCounts` tests once in isolation to rule out
   order-dependence, against the embedded Postgres. The failure path was 
verified by
   breaking an assertion (1 failed, non-zero exit), and `Test/scalafmtCheck` +
   `Test/scalafix --check` are 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