Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for hpascaletargetmarker controller #5553

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anujagrawal699
Copy link
Contributor

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

@karmada-bot karmada-bot added the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label Sep 14, 2024
@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 14, 2024
@karmada-bot karmada-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2024

⚠️ 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 ✅

Project coverage is 34.13%. Comparing base (ba360c9) to head (50634c5).
Report is 14 commits behind head on master.

❗ 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%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@XiShanYongYe-Chang
Copy link
Member

Thanks~
/assign

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

LGTM
Ask code owner @chaosi-zju to help take a review.
/cc @chaosi-zju

})
}
}
func TestDeleteHPALabelFromScaleRef(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Here need a blank line.

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>

Added tests for hpascaletargetmarker controller

Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
@anujagrawal699 anujagrawal699 force-pushed the addedTests-controllers/hpascaletargetmarker branch from 98264eb to 50634c5 Compare September 20, 2024 09:54
@karmada-bot
Copy link
Collaborator

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants