karmada icon indicating copy to clipboard operation
karmada copied to clipboard

Added tests for mcs controller

Open anujagrawal699 opened this issue 1 year ago • 4 comments

Description: This PR introduces comprehensive unit tests for the Multi-Cluster Services (MCS) controllers. These tests aim to improve code reliability and facilitate easier maintenance and future development.

Additions:

  1. pkg/controllers/mcs/endpointslice_controller_test.go
  2. pkg/controllers/mcs/service_export_controller_test.go
  3. pkg/controllers/mcs/service_import_controller_test.go

Test Coverage:

  1. endpointslice_controller_test.go : 0% to 46%
  2. service_export_controller_test.go : 0% to 39.1%
  3. service_import_controller_test.go : 0% to 65%

Overall coverage of MCS controller : 0% to 44.4%

What type of PR is this? /kind failing-test /kind feature

Which issue(s) this PR fixes: Fixes a part of #5470

Does this PR introduce a user-facing change?:

NONE

anujagrawal699 avatar Sep 18 '24 17:09 anujagrawal699

: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 34.43%. Comparing base (ec0521a) to head (8a4923f). Report is 346 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    #5566      +/-   ##
==========================================
+ Coverage   34.15%   34.43%   +0.27%     
==========================================
  Files         643      645       +2     
  Lines       44515    44857     +342     
==========================================
+ Hits        15203    15445     +242     
- Misses      28155    28240      +85     
- Partials     1157     1172      +15     
Flag Coverage Δ
unittests 34.43% <ø> (+0.27%) :arrow_up:

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.


🚨 Try these New Features:

codecov-commenter avatar Sep 18 '24 18:09 codecov-commenter

Thanks /assign

XiShanYongYe-Chang avatar Sep 20 '24 08:09 XiShanYongYe-Chang

[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 ask for approval from xishanyongye-chang. 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 Sep 20 '24 10:09 karmada-bot

@XiShanYongYe-Chang Made the changes as you suggested.

anujagrawal699 avatar Sep 22 '24 15:09 anujagrawal699