-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
unit test for kubectl config set #43517
Conversation
Hi @zjj2wry. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with 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/test-infra repository. I understand the commands that are listed here. |
ce0bb63
to
8e6981c
Compare
pkg/kubectl/cmd/config/set_test.go
Outdated
} | ||
} | ||
if len(test.args) == 2 { | ||
if test.args[1] != config.CurrentContext { |
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 means that the test struct only works for testing set against the current context right? That's ok, but its more restrictive than the name suggests. How about comparing against the expectedConfig
instead?
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.
yes,i start want compare config , but real config will initialize some nil map , and LocationOfOrigin etc. so my expectConfig can not initialize completely in testcases.
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.
yes,i start want compare config , but real config will initialize some nil map , and LocationOfOrigin etc. so my expectConfig can not initialize completely in testcases.
Before the comparison, you could clear the LocationOfOrigin
and you could initialize the maps in your expectConfig
.
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.
@deads2k sorry to reply late. i will update like you say. think you very much
@zjj2wry: you can't request testing unless you are a kubernetes member. 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/test-infra repository. I understand the commands that are listed here. |
/lgtm |
@deads2k: you can only set release notes if you are the author or an assignee. 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/test-infra repository. I understand the commands that are listed here. |
@k8s-bot ok to test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, zjj2wry
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot verify test this |
@zjj2wry: you can't request testing unless you are a kubernetes member. 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/test-infra repository. I understand the commands that are listed here. |
@k8s-bot verify test this |
@zjj2wry: The following test(s) failed:
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue |
What this PR does / why we need it:
unit test for kubectl config set
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
think you
Release note: