-
Notifications
You must be signed in to change notification settings - Fork 885
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 federatedresourcequota controller #5535
Added tests for federatedresourcequota controller #5535
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5535 +/- ##
==========================================
+ Coverage 33.86% 34.03% +0.16%
==========================================
Files 643 643
Lines 44509 44509
==========================================
+ Hits 15072 15147 +75
+ Misses 28288 28208 -80
- Partials 1149 1154 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if tt.expectedError { | ||
assert.Error(t, err) | ||
} else { | ||
assert.NoError(t, err) | ||
} | ||
assert.Equal(t, tt.expectedResult, result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only judgment is meaningless. Can more logical judgments be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @XiShanYongYe-Chang , Thanks for the review. Actually the reconciliation logic and setting up manager are too complex to test and need extensive mocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, the test function can be removed first because it is a cost to maintenance and it has not yet produced test value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that will be a good step. Thanks!
Signed-off-by: Anuj Agrawal <[email protected]> Added tests for federatedresourcequota controller Signed-off-by: Anuj Agrawal <[email protected]>
eed5cb2
to
6bbbf9d
Compare
/retest |
@anujagrawal699: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@XiShanYongYe-Chang Retest please. |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description:
This PR introduces comprehensive unit tests for the Federated Resource Quota controller and for parts which are not much complex to test.
Additions:
Test Coverage Improvements:
Federated Resource Quota Controller Coverage: 0% to 51.3%
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?: