Skip to content

test(frontend): extend ComputingUnitStatusService unit test coverage#6819

Open
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:test-fe-cu-status-service
Open

test(frontend): extend ComputingUnitStatusService unit test coverage#6819
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:test-fe-cu-status-service

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends computing-unit-status.service.spec.ts with 8 tests (18 -> 26), covering selectComputingUnit'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:ci passes.

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

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

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%.
Copilot AI review requested due to automatic review settings July 23, 2026 05:04
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15
    You can notify them by mentioning @mengw15 in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.53%. Comparing base (110a54c) to head (3ef8452).
⚠️ Report is 9 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from fa5502d
agent-service 76.76% <ø> (ø) Carriedforward from fa5502d
amber 67.33% <ø> (ø) Carriedforward from fa5502d
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from fa5502d
config-service 66.66% <ø> (ø) Carriedforward from fa5502d
file-service 67.21% <ø> (ø) Carriedforward from fa5502d
frontend 82.29% <ø> (+0.58%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from fa5502d
pyamber 92.15% <ø> (ø) Carriedforward from fa5502d
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from fa5502d

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan

Copy link
Copy Markdown
Contributor Author

Closing as it doesn't increase coverage

@aglinxinyuan aglinxinyuan reopened this Jul 23, 2026
@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 23, 2026 23:49
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
@aglinxinyuan
aglinxinyuan enabled auto-merge July 24, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend ComputingUnitStatusService unit test coverage

3 participants