-
Notifications
You must be signed in to change notification settings - Fork 890
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
pkg/karmadactl: unit test cordon #5829
base: master
Are you sure you want to change the base?
pkg/karmadactl: unit test cordon #5829
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 #5829 +/- ##
==========================================
+ Coverage 46.30% 46.43% +0.12%
==========================================
Files 661 661
Lines 54308 54308
==========================================
+ Hits 25147 25217 +70
+ Misses 27536 27459 -77
- Partials 1625 1632 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
{ | ||
name: "RunCordonOrUncordon_CordonUncordonedCluster_ClusterCordoned", | ||
desiredCordonStatus: DesiredCordon, | ||
f: testFactory{client: fakekarmadaclient.NewSimpleClientset()}, |
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.
How about using NewClientset
to replace NewSimpleClientset
?
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.
This package appears to lack a NewClientset
function?
fakekarmadaclient "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/fake"
In contrast to:
"k8s.io/client-go/kubernetes/fake"
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.
You're right. I've just noticed that in this sense, direct revisions are not necessarily effective. You can try them.
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.
I found using NewClientset
is not feasible since it is part of kubernetes/fake
package and util.Factory
accepts client of type karmadaclientset.Interface
which part of karmada/pkg/generated/clientset/versioned
package.
/assign |
3a9513f
to
bd53309
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
In this commit, we unit test cordon on karmadactl client making sure the cordon/uncordon working as expected on a given cluster. Signed-off-by: Mohamed Awnallah <[email protected]>
bd53309
to
bdb9fb8
Compare
Description
In this commit, we unit test cordon on karmadactl client making sure the cordon/uncordon working as expected on a given cluster.
What type of PR is this?
Which issue(s) this PR fixes:
Part of #5491.
Does this PR introduce a user-facing change?: