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

   ### What changes were proposed in this PR?
   
   The spec covered the pure transforms and the namespace-wide wrappers and 
stopped. The single-pod
   half of the class — `getPodByName`, `podExists`, `getPodLimits`, 
`createPod`, `deletePod` and the
   pod URI — was untested, which is 42 of the file's 62 lines.
   
   None of it needs a cluster: the fabric8 client is already a constructor 
parameter, so the existing
   Mockito fixture extends to the rest of the fluent chain, with the pod that 
`createPod` builds
   captured and inspected rather than sent anywhere.
   
   Adds 8 tests. The three that matter:
   
   - **the guard that refuses to overwrite a live pod** — creating over a 
running unit would detach it
     from its owner;
   - **the `Option(...)` wrapper around the by-name lookup** — fabric8 returns 
`null` for an absent
     pod rather than throwing, so the wrapper is all that stands between a 
caller and an NPE;
   - **the shared-memory volume appearing only when a size is requested** — 
`/dev/shm` defaults to
     64 Mi, too small for the Python workers, and the volume must not appear 
when unrequested.
   
   Also covered: the pod URI's service and namespace segments, the first 
container's resource limits
   and the empty-map fallback, env values reaching the container as strings, 
and `deletePod` targeting
   the cuid's own pod.
   
   **Verified by mutation**, all reverted (production diff empty):
   
   | Mutation | Result |
   |---|---|
   | pod name loses the cuid suffix | red |
   | URI drops the namespace segment | red |
   | `getPodByName` no longer null-guards | red |
   | `createPod` overwrites an existing pod | red |
   | cpu limit written from the memory value | red |
   | pod hostname is not the pod name | red |
   | `deletePod` targets a fixed cuid | red |
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7510
   
   ### How was this PR tested?
   
   ```
   sbt "ComputingUnitManagingService/testOnly 
org.apache.texera.service.util.KubernetesClientSpec"
   ```
   
   ```
   [info] Total number of tests run: 16
   [info] Tests: succeeded 16, failed 0, canceled 0, ignored 0, pending 0
   ```
   
   8 new on top of the existing 8. `Test/scalafmtCheck` and `Test/scalafix 
--check` both pass.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


-- 
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