karmada
karmada copied to clipboard
Added unit tests for node_tree in pkg/util/lifted/scheduler/cache
/kind feature
This PR introduces unit tests for the node_tree file :
- TestNewNodeTree: Initialize a
NodeTreewith nodes. - TestAddNode: Add a new node to the
NodeTree. - TestAddExistingNode: Handle adding an existing node.
- TestRemoveNode: Remove a node from the
NodeTree. - TestRemoveNonExistentNode: Attempt to remove a non-existent node.
- TestUpdateNode: Update node details.
- TestList: List all nodes.
- TestListEmpty: Handle an empty
NodeTree. - TestListExhaustedZones: Handle exhausted zones.
Fixes part of #5235
Coverage : 96.5 %
Does this PR introduce a user-facing change?:
NONE
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign xishanyongye-chang for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 30.40%. Comparing base (
aee21b8) to head (e21572d). Report is 24 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5422 +/- ##
==========================================
- Coverage 30.58% 30.40% -0.18%
==========================================
Files 632 632
Lines 43936 43936
==========================================
- Hits 13438 13360 -78
- Misses 29519 29622 +103
+ Partials 979 954 -25
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 30.40% <ø> (-0.18%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/retest
@XiShanYongYe-Chang , the pr has passed the ci tests, we can move ahead with the review .
Thanks 😊