karmada icon indicating copy to clipboard operation
karmada copied to clipboard

Added tests for hpascaletargetmarker controller

Open anujagrawal699 opened this issue 1 year ago • 4 comments

Description: This PR introduces comprehensive unit tests for the HPA Scale Target Marker controller, predicate, and worker components. These tests aim to improve code reliability and facilitate easier maintenance and future development.

Additions:

  1. pkg/controllers/hpascaletargetmarker/hpa_scale_target_marker_controller_test.go
  2. pkg/controllers/hpascaletargetmarker/hpa_scale_target_marker_predicate_test.go
  3. pkg/controllers/hpascaletargetmarker/hpa_scale_target_marker_worker_test.go

Test Coverage:

  1. hpa_scale_target_marker_controller_test.go : 0% to 100%
  2. hpa_scale_target_marker_predicate_test.go : 0% to 96.7%
  3. hpa_scale_target_marker_worker_test.go : 0% to 70.3% Overall coverage of hpascaletargetmarker controller: 0% to 79.8%

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

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

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

anujagrawal699 avatar Sep 14 '24 18: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.13%. Comparing base (ba360c9) to head (50634c5). Report is 50 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    #5553      +/-   ##
==========================================
- Coverage   34.14%   34.13%   -0.01%     
==========================================
  Files         643      645       +2     
  Lines       44524    44857     +333     
==========================================
+ Hits        15203    15313     +110     
- Misses      28165    28379     +214     
- Partials     1156     1165       +9     
Flag Coverage Δ
unittests 34.13% <ø> (-0.01%) :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 Sep 14 '24 18:09 codecov-commenter

Thanks~ /assign

XiShanYongYe-Chang avatar Sep 20 '24 09: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 09:09 karmada-bot

@chaosi-zju Please take a look.

anujagrawal699 avatar Sep 27 '24 06:09 anujagrawal699