aglinxinyuan opened a new pull request, #9652: URL: https://github.com/apache/texera/pull/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 parameterized builders: a pod being deleted, with an optional status, and 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"` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Antigravity (Gemini) and Claude Code (Claude Opus 5.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]
