You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "mengw15 (via GitHub)" <gi...@apache.org> on 2026/07/22 03:27:36 UTC

[I] add unit test coverage for ComputingUnitSelectionComponent resource-formatting getters [texera]

mengw15 opened a new issue, #6745:
URL: https://github.com/apache/texera/issues/6745

   ### Task Summary
   
   `ComputingUnitSelectionComponent` sits at codecov ~66% (130 uncovered lines) — its spec covers the interaction flows but leaves the resource-formatting and status-display getters untested. Extend the spec to cover those pure getters. jsdom/Vitest; see `frontend/TESTING.md`.
   
   ### Behavior to add
   
   **ComputingUnitSelectionComponent** (`frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts`, codecov ~66% — EXTEND; spec covers flows, not the getters)
   
   Scope: the **pure resource-formatter and status-display getters** — each delegates to a pure util from the current computing unit's values, so seed the component's selected unit (or stub the `getCurrentComputingUnit*` accessors) and assert the returned value:
   
   - CPU: `getCpuLimit` / `getCpuValue` / `getCpuUnit` / `getCpuLimitUnit` / `getCpuPercentage` / `getCpuStatus` — assert formatted numbers/units and that `getCpuStatus` maps a percentage to `"success" | "exception" | "active" | "normal"`.
   - Memory: `getMemoryLimit` / `getMemoryValue` / `getMemoryUnit` / `getMemoryLimitUnit` / `getMemoryPercentage` / `getMemoryStatus` — same shape.
   - Other resources: `getGpuLimit` / `getJvmMemorySize` / `getSharedMemorySize`.
   - Status/display: `computeStatus` / `getButtonText` / `getBadgeColor(status)` / `getUnitStatusTooltip` / `isComputingUnitRunning` / `isSelectedUnit` / `isCreateDisabled(pve)` / `cannotSelectUnit` — assert the string/boolean for representative inputs.
   - Trivial: `trackByCuid` / `trackByIndex` return the identity key.
   
   Out of scope (separate issue): the WebSocket/HTTP/service-driven methods (`runPveWebSocket`, `refreshUserPackages`, `refreshAvailableDbPves`, `createVirtualEnvironment`, `installUserPackages`, `terminateComputingUnit`, `selectComputingUnit`) — they need service mocks.
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
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: notifications-unsubscribe@texera.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] add unit test coverage for ComputingUnitSelectionComponent resource-formatting getters [texera]

Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 closed issue #6745: add unit test coverage for ComputingUnitSelectionComponent resource-formatting getters
URL: https://github.com/apache/texera/issues/6745


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] add unit test coverage for ComputingUnitSelectionComponent resource-formatting getters [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6745:
URL: https://github.com/apache/texera/issues/6745#issuecomment-5041505957

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @mengw15!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org