The GitHub Actions job "Running Copilot Code Review" on texera.git/main has 
failed.
Run started by GitHub user Copilot (triggered by Copilot).

Head commit for run:
4f828836c35df5bfb70983f76aeee7bf18969c06 / Meng Wang <[email protected]>
test(frontend): extend ComputingUnitSelectionComponent coverage with resource 
getters (#6555)

### What changes were proposed in this PR?

Extends the existing `ComputingUnitSelectionComponent` spec
(`frontend/src/app/workspace/component/power-button/`, codecov ~59%) to
cover the
previously-untested resource-display getters and a few small handlers.
Follows
`frontend/TESTING.md` and reuses the existing `makeComputingUnit`
fixture.

Adds 13 tests:

- **resource accessors** — `getCurrentComputingUnit{Cpu,Memory}Usage`,
`getCurrentComputingUnit{Cpu,Memory,Gpu}Limit`,
`getCurrentComputingUnitJvmMemorySize`,
`getCurrentSharedMemorySize`: read the selected unit's raw values, and
return
  `"NaN"` for every accessor when nothing is selected.
- **derived getters** — `getCpuLimit`/`getMemoryLimit` (numbers),
`getGpuLimit`/
`getJvmMemorySize`/`getSharedMemorySize`,
`getCpuLimitUnit`/`getMemoryLimitUnit`/
`getCpuUnit`/`getMemoryUnit`;
`getCpuValue`/`getMemoryValue`/`getCpuPercentage`/
`getMemoryPercentage` return 0 when metrics are unavailable;
`getCpuStatus`/
`getMemoryStatus` map to `"success"`; `getBadgeColor` and
`getUnitStatusTooltip`
  map status → color/tooltip.
- **misc handlers** — `trackByCuid`/`trackByIndex` identity,
`cancelEditingUnitName`
state reset, `openComputingUnitMetadataModal` opens the metadata modal
with the
unit as `nzData`, and `scrollToBottomOfPipModal` scrolls the deferred
pip-log
  element (and is a safe no-op when it is absent).

No production code was changed.

### Any related issues, documentation, discussions?

Closes #6551

### How was this PR tested?

Extended Vitest spec, run locally in `frontend/` (whole file green, run
4× to
confirm determinism; failure path verified by breaking an assertion). To
stay
deterministic, `scrollToBottomOfPipModal` is driven with fake timers and
a
stubbed `document.getElementById` (a plain stand-in object, restored
after each
test) rather than relying on jsdom layout.

```
ng test --watch=false --include 
src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts
# Test Files 1 passed (1) / Tests 100 passed (100)
eslint <spec>      # clean
prettier --check   # clean
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

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

With regards,
GitHub Actions via GitBox

Reply via email to