-
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
Created unit tests for GCE cloud provider storage interface. #44884
Conversation
Hi @verult. 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. |
/approve |
1 similar comment
/approve |
@k8s-bot ok to test |
0dfb427
to
e818754
Compare
} | ||
|
||
type ServiceManager interface { | ||
CreateDisk( |
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 add comments to each functions in the interface?
t.Error("Ops used in WaitForZoneOp does not match what's returned by CreateDisk.") | ||
} | ||
// Partial check of equality between disk description sent to GCE and parameters of method. | ||
if fakeManager.diskToCreate.Name != diskName || fakeManager.diskToCreate.SizeGb != sizeGb { |
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 also verify the tags, and diskTypeUri fields. And make each field a separate check.
t.Errorf("Error creating disk in zone '%v'; error: \"%v\"", zone, err) | ||
} | ||
} | ||
} |
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.
Another test case for CreateDisk is the disk was already created.
Also instead of calling it GCE storage class, I would call it GCE cloud provider storage interface. We have a Kubernetes concept called storage classes, which is totally different than this. |
|
||
type ServiceManager interface { | ||
// Creates a new persistent disk on GCE with the given disk spec. | ||
CreateDisk( |
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 conform with the rest of the files, can you put all the arguments on the same line?
/release-note-none |
- Currently covers CreateDisk and DeleteDisk, GetAutoLabelsForPD - Created ServiceManager interface in gce.go to facilitate mocking in tests.
@verult: 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. |
@k8s-bot pull-kubernetes-unit test this |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jingxu97, msau42, verult
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 46383, 45645, 45923, 44884, 46294) |
What this PR does / why we need it:
Increasing test coverage for GCE Persistent Disk.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #44573Release note: