-
Notifications
You must be signed in to change notification settings - Fork 103
CCXDEV-15561: Improve test coverage 2 #1199
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
base: master
Are you sure you want to change the base?
CCXDEV-15561: Improve test coverage 2 #1199
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: katushiik11 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
9188d16 to
87d6589
Compare
|
@katushiik11: This pull request references CCXDEV-15561 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/retest |
|
@katushiik11: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
| }{ | ||
| { | ||
| name: "storage path already exists", | ||
| setupPath: func() string { |
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 would prefer to refactor the inline anonymous functions setupPath and cleanupPath into a helper function and pass arguments to it from the test.
| input: "Hello, World! This is a long string.", | ||
| limit: 5, | ||
| bufferSize: 20, | ||
| verifyDetails: func(t *testing.T, lr *LimitedReader, n int, err error) { |
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.
Same here, I think it could be reworked using a boolean flag and adding the assertions directly in the test.
| statusCode: http.StatusNotFound, | ||
| responseBody: "Not found", | ||
| expectError: true, | ||
| verifyError: func(t *testing.T, err error) { |
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.
Same here
| name string | ||
| includeClusterID bool | ||
| param string | ||
| verifyPath func(t *testing.T, path string) |
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 case is probably the only one where an anonymous function makes sense, since the body of the function changes.
|
/cc @ncaak |
This PR implements tests to improve test coverage in directories controller and insightsclient.
Categories
Sample Archive
Documentation
Unit Tests
pkg/controller/kubeconfigs_test.gopkg/controller/operator_test.gopkg/insights/insightsclient/insightsclient_test.gopkg/insights/insightsclient/reader_test.goPrivacy
Yes. There are no sensitive data in the newly collected information.
Changelog
None
Breaking Changes
No
References
https://issues.redhat.com/browse/CCXDEV-15561