The GitHub Actions job "Comment commands" on texera.git/main has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
d335251c3721f8748db261c9a0bf6e3a28b23684 / Xinyuan Lin <[email protected]>
refactor(computing-unit): share status dispatch and fixtures (#9652)

### What changes were proposed in this PR?
`ComputingUnitHelpers` resolved a computing unit's status and metrics in
four places. `singleUnitStatusAndReason` and
`getComputingUnitMetrics(unit)` ask the cluster about one unit, and the
two overloads that take pre-fetched pod snapshots or pod metrics read
them from a map. Each repeated the same local / Kubernetes / other
match. All four now go through two private dispatchers, `statusFrom` and
`metricsFrom`. Each takes the pod lookup by name, so the cluster or the
map is still consulted only for a Kubernetes unit. A local unit stays
Running with NaN metrics, and any other type stays Pending with NaN
metrics.

`ComputingUnitHelpersSpec` now builds its pods from two builders:
`terminatingPod` marks any pod as being deleted, and `podWithContainers`
builds a pod with any number of container states. It drives the four
`singleUnitStatusAndReason` cases through one stubbed client and names
each expected failure reason once. Every case keeps its name, and every
expected message keeps its exact text.

### Any related issues, documentation, discussions?
Closes #9651.

### How was this PR tested?
- `sbt "ComputingUnitManagingService/test"`: the 322 tests across 15
suites pass on main and on this branch, with the same names in the same
order, compared case by case from the JUnit XML reports.
- Mutation check: mapping a local unit to Pending in `statusFrom` and
swapping cpu and memory in `metricsFrom` fails 8 tests across
`ComputingUnitHelpersSpec`, `ComputingUnitManagingResourceSpec` and
`AdminComputingUnitResourceSpec`, through both the per-unit and the
map-based lookups; every other test passes.
- `sbt "ComputingUnitManagingService/scalafmtCheck"
"ComputingUnitManagingService/Test/scalafmtCheck"
"ComputingUnitManagingService/scalafix --check"
"ComputingUnitManagingService/Test/scalafix --check"`
- After review, f3c7f8989b changes only `ComputingUnitHelpersSpec`:
`terminatingPod` takes the pod to mark, and the eviction-precedence case
reuses `diskEvictionMessage`. The spec passes 60/60 on it with the same
names in the same order, and `Test/scalafmtCheck` and `Test/scalafix
--check` pass.

### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity (Gemini) and Claude Code (Claude Opus 5.5)

Report URL: https://github.com/apache/texera/actions/runs/45531490699

With regards,
GitHub Actions via GitBox

Reply via email to