-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
query_test.go added - TestValidate method defined #2298
Conversation
Hi @shekhar-rajak. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Please let me know, if I need to squash the commits. |
/ok-to-test |
I would squash the commits :) Pinging @jeremyrickard @palnabarun since they're working on this - also I don't see a kepval/kepctl label for these types of prs? should we add. |
pkg/kepctl/query_test.go
Outdated
@@ -0,0 +1,89 @@ | |||
/* | |||
Copyright 2020 The Kubernetes Authors. |
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.
oo, 2021
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 for the review. I think we need to change this line every file, where we have Copyright 2020 written
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.
Copyright headers of all files need not be changed. IIRC, whenever we create a new file, we use the year of creation.
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.
@palnabarun is correct, just when a new file is created.
I have squashed the commits. Please review. |
Once this is merged I can add more testcases as part of #2282 |
/sig release |
/cc |
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.
Also q for line 69 comment: "// check if the Output specified is one of "", "json" or "yaml""
It seems stale? Shouldnt that be table json yaml? If so could you update since we're in the file anyway? :)
pkg/kepctl/query.go
Outdated
@@ -54,7 +54,7 @@ type QueryOpts struct { | |||
} | |||
|
|||
// Validate checks the args and cleans them up if needed |
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.
Q (since you're in this file already 😄 ): is this comment^^ correct?
I don't really see the func cleaning them up?
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, we can see function is not using the args now. Removing this comment. Thanks for the review.
I think, now it is good to test and review. Once this PR is merged, I will work on #2282 test cases |
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.
@shekhar-rajak -- Just two nits here.
pkg/kepctl/query_test.go
Outdated
/* | ||
|
||
TO run the test case: go test -v query_test.go create.go kepctl.go promote.go query.go | ||
|
||
*/ |
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.
/* | |
TO run the test case: go test -v query_test.go create.go kepctl.go promote.go query.go | |
*/ |
You can drop this note.
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.
Done
pkg/kepctl/query_test.go
Outdated
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" |
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.
Tool choice nit: prefer require
instead of assert
Example usage: https://github.com/kubernetes/release/blob/dd16298a1a178a937e02c69a69d6e2c15484fc4e/pkg/anago/anago_test.go#L23
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.
Done
Validate funtion: removed unused arguments minor change: Copyright 2020 to Copyright 2021 Unnecessary comment is removed Using require instead of assert in test file
Thanks @justaugustus, for the review. I have updated the commit. I think now it is good to go. |
Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus, shekhar-rajak 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 |
Related to #2297