karmada icon indicating copy to clipboard operation
karmada copied to clipboard

Added unit tests for node_tree in pkg/util/lifted/scheduler/cache

Open yashpandey06 opened this issue 1 year ago • 4 comments

/kind feature

This PR introduces unit tests for the node_tree file :

  1. TestNewNodeTree: Initialize a NodeTree with nodes.
  2. TestAddNode: Add a new node to the NodeTree.
  3. TestAddExistingNode: Handle adding an existing node.
  4. TestRemoveNode: Remove a node from the NodeTree.
  5. TestRemoveNonExistentNode: Attempt to remove a non-existent node.
  6. TestUpdateNode: Update node details.
  7. TestList: List all nodes.
  8. TestListEmpty: Handle an empty NodeTree.
  9. TestListExhaustedZones: Handle exhausted zones.

Fixes part of #5235

Coverage : 96.5 %

Does this PR introduce a user-facing change?:

NONE

yashpandey06 avatar Aug 25 '24 19:08 yashpandey06

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar Aug 25 '24 19:08 karmada-bot

:warning: Please install the 'codecov app svg image' 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.

codecov-commenter avatar Aug 25 '24 20:08 codecov-commenter

/retest

XiShanYongYe-Chang avatar Aug 26 '24 02:08 XiShanYongYe-Chang

@XiShanYongYe-Chang , the pr has passed the ci tests, we can move ahead with the review .

Thanks 😊

yashpandey06 avatar Aug 26 '24 03:08 yashpandey06