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 graceful eviction controller #5543

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

Conversation

anujagrawal699
Copy link
Contributor

Description:
This PR adds comprehensive unit tests for the ResourceBinding (RB) and ClusterResourceBinding (CRB) graceful eviction controllers.

Additions:

  1. pkg/controllers/gracefuleviction/crb_graceful_eviction_controller_test.go
  2. pkg/controllers/gracefuleviction/rb_graceful_eviction_controller_test.go
    Additionally, a new test case has been added to the Test_nextRetry function in evictiontask_test.go to increase coverage.

Test Coverage:

  1. crb_graceful_eviction_controller_test.go : 0% to 62.5%
  2. rb_graceful_eviction_controller_test.go : 0% to 62.5%
  3. evictiontask_test.go : 98% to 100%
    Overall graceful eviction controller : 35.90% to 76.7%

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

@karmada-bot karmada-bot added the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label Sep 13, 2024
@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 13, 2024
@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 assign whitewindmills 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 karmada-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 13, 2024
@anujagrawal699 anujagrawal699 force-pushed the addedTests-controllers/gracefuleviction branch from f615e61 to 6edcb2a Compare September 13, 2024 16:08
@anujagrawal699
Copy link
Contributor Author

Hi @zhzhuang-zju , the tests are working fine locally. What can be the problem in setupManager test.

@zhzhuang-zju
Copy link
Contributor

Hi @zhzhuang-zju , the tests are working fine locally. What can be the problem in setupManager test.

From the CI error messages, the reason for the test failure is not clear. I will try to analyze the cause of the failure from the code perspective.

@anujagrawal699
Copy link
Contributor Author

Hi @zhzhuang-zju , the tests are working fine locally. What can be the problem in setupManager test.

From the CI error messages, the reason for the test failure is not clear. I will try to analyze the cause of the failure from the code perspective.

The setup manager tests fails for each controller everytime on the CI, i had removed that tests from some of my last PR's. I haven't been able to find the root cause of CI failures for them.

@zhzhuang-zju
Copy link
Contributor

The setup manager tests fails for each controller everytime on the CI, i had removed that tests from some of my last PR's. I haven't been able to find the root cause of CI failures for them.

Cannot determine the root cause of the test failure. You can try adding output logs and use your private repository's CI to identify the issue.

@anujagrawal699
Copy link
Contributor Author

The setup manager tests fails for each controller everytime on the CI, i had removed that tests from some of my last PR's. I haven't been able to find the root cause of CI failures for them.

Cannot determine the root cause of the test failure. You can try adding output logs and use your private repository's CI to identify the issue.

I'm not able to debug it, i think we should proceed without it.

@anujagrawal699 anujagrawal699 force-pushed the addedTests-controllers/gracefuleviction branch 2 times, most recently from 2ff858e to 80b715b Compare September 18, 2024 18:06
Signed-off-by: Anuj Agrawal <[email protected]>

Added tests for gracefuleviction controller

Signed-off-by: Anuj Agrawal <[email protected]>

Added tests for gracefuleviction contoller

Signed-off-by: Anuj Agrawal <[email protected]>

Added tests for gracefuleviction controller

Signed-off-by: Anuj Agrawal <[email protected]>

Added tests for gracefuleviction controller

Signed-off-by: Anuj Agrawal <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 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.27%. Comparing base (2e60a6e) to head (547a6a9).
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    #5543      +/-   ##
==========================================
+ Coverage   34.14%   34.27%   +0.12%     
==========================================
  Files         643      643              
  Lines       44509    44503       -6     
==========================================
+ Hits        15197    15252      +55     
+ Misses      28156    28090      -66     
- Partials     1156     1161       +5     
Flag Coverage Δ
unittests 34.27% <ø> (+0.12%) ⬆️

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.

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