-
Notifications
You must be signed in to change notification settings - Fork 806
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
Add csi-sanity tests #2254
base: master
Are you sure you want to change the base?
Add csi-sanity tests #2254
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
Code Coverage Diff
|
5d1d3b3
to
72c4b10
Compare
/retest |
1cd6007
to
79b840d
Compare
e328221
to
508b90e
Compare
508b90e
to
d8859ed
Compare
IDGen: csisanity.DefaultIDGenerator{}, | ||
TestVolumeSize: 10 * util.GiB, | ||
TestVolumeAccessType: "mount", | ||
TestVolumeMutableParameters: map[string]string{"iops": "3014", "throughput": "153"}, |
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.
Is there a reason we don't also provide a TestVolumeParameters
struct, like we provide TestVolumeMutableParameters, TestVolumeAccessType, etc?
Do no sanity tests utilize 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.
Nope I would be happy to add it though if we want to . TestVolumeMutableParameters was explicitly added here as without it we don't succeeded on our modify_volume tests as we quit early when no parameters to modify the volume are specified.
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 I would add something, like volumeType: gp3, iops: 3000
to TestVolumeParameters, in case future sanity tests rely on it.
I know there is some discussion of using in kubernetes-csi/csi-test#549
Thanks!
return fakeMounter, fakeCloud, fakeMetadataService, fakeKubernetesClient | ||
} | ||
|
||
func mockNodeService(m *mounter.MockMounter, md *metadata.MockMetadataService) { |
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.
Is there a reason you prefer relying heavily on mocks within these two mega-mock functions in sanity_test.go (for node/controller service), instead of creating fake implementations similar to mount_unsupported https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/pkg/mounter/mount_unsupported.go?
Perhaps this was was cleaner than the alternative? But the presence of so many m.Expect().<Some mounter function>(gomock.Any()).DoAndReturn(...)
piqued my interest.
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.
No the only reason I had for doing so was to keep in party with previous CSI Sanity tests Eddie implemented. I would be more than happy to add a fake_sanity_node.go and fake_sanity_controller.go if folks think this is cleaner.
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.
+1. Fakes are easier to maintain and lot cleaner.
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.
Perfect will do in next rev
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.
No the only reason I had for doing so was to keep in party with previous CSI Sanity tests Eddie implemented
Ah, IIRC poor eddie had to do that because he implemented those tests before his lovely mounter package refactor.
If you do decide to make the fakes, please hide them inside tests/sanity
to make sure they are only used here (in line with issue #220)
What type of PR is this?
/kind feature
What is this PR about? / Why do we need it?
This PR adds csi-sanity tests to the driver to be enable in CI afterwards.
How was this change tested?
Ran
make test-sanity
and received the following results
Does this PR introduce a user-facing change?