test(frontend): extend ComputingUnitStatusService unit test coverage#6819
test(frontend): extend ComputingUnitStatusService unit test coverage#6819aglinxinyuan wants to merge 2 commits into
Conversation
Add 8 tests covering selectComputingUnit cache-miss/no-op/reconnect paths, the websocket open with (wid,uid,cuid), and the status/metric stream branches. Coverage 82% -> ~100%.
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
Pull request overview
This PR expands frontend unit test coverage for ComputingUnitStatusService, focusing on previously untested branches in selectComputingUnit(), refresh interval lifecycle, and terminateComputingUnit() behavior.
Changes:
- Added tests for
selectComputingUnit()cache-miss flow and reconnect/guard branches. - Added a test ensuring
startRefreshInterval()replaces an existing refresh subscription. - Added tests covering
terminateComputingUnit()socket teardown behavior and error handling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6819 +/- ##
============================================
+ Coverage 76.27% 76.53% +0.25%
Complexity 3452 3452
============================================
Files 1161 1161
Lines 45919 45920 +1
Branches 5100 5100
============================================
+ Hits 35025 35143 +118
+ Misses 9329 9240 -89
+ Partials 1565 1537 -28
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing as it doesn't increase coverage |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
What changes were proposed in this PR?
Extends
computing-unit-status.service.spec.tswith 8 tests (18 -> 26), coveringselectComputingUnit's cache-miss (refresh + wait-for-unit + websocket open), no-op guard (same wid+cuid), and reconnect-on-wid-change paths, the websocket open with(wid, uid, cuid), and the status/metric stream branches. Coverage 82% -> ~100%. No existing tests modified.Any related issues, documentation, discussions?
Closes #6815.
How was this PR tested?
ng test --include='**/computing-unit-status.service.spec.ts'-> 26/26 passing.yarn format:cipasses.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])