-
Notifications
You must be signed in to change notification settings - Fork 47
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
test: add and cleanup vm-console-proxy operand #509
Conversation
@akrejcir FYI, it can be reviewed except an issue in |
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.
Can you also cleanup the names of functions?
I'll rename that PR to add only new tests, and open another PR to have refactored functions. |
This PR is ready for review, except some issue with the commented lines:
It throws nil error when I try to test it. |
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.
A partial review.
In general, unit tests don't need to test every single private function. Private functions can change. Tests should cover visible behavior of a module:
- Exported functions and methods
- Exported structs
- Exported fields of structs
In my opinion, an exception to this guideline is if a private function has complex implementation and we want to make sure that it works.
@akrejcir Ah okay :) I'm so sorry. I never wrote before operator tests. I thought we should test all operand functions because it plays critical role in deploying |
@akrejcir Sorry, what do you mean? |
/retest |
I meant that function names in |
Can you add unit tests for the annotations functionality? To test these cases:
|
Done, please review.
@akrejcir Done, please review as well. But, what is the purpose of that test? Isn't similar to
Before we call to Cleanup? |
Add and cleanup operand unit tests. Signed-off-by: Ben Oukhanov <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/retest |
/lgtm |
@akrejcir Seems like approval is missing and it wasn't merged because of it. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akrejcir 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 |
Cleanup() method of vm-console-proxy deletes resources from the correct namespace. Manual backport of b72b74f. NOTE: The PR could not be trivially backported, because intermediate PRs were not backported, and that caused git conflicts. To fix the conflicts, unit tests were not included. - Refactoring PR: kubevirt#515 - PR that adds more unit tests: kubevirt#509 Signed-off-by: Andrej Krejcir <[email protected]>
What this PR does / why we need it:
Add and cleanup operand unit tests.
Release note: