-
Notifications
You must be signed in to change notification settings - Fork 808
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
/hold |
Code Coverage Diff
|
5d1d3b3
to
72c4b10
Compare
/retest |
1cd6007
to
79b840d
Compare
e328221
to
508b90e
Compare
508b90e
to
d8859ed
Compare
3dc7cd8
to
70c4ce9
Compare
45ade56
to
80ddf8b
Compare
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.
/lgtm
80ddf8b
to
edc0e41
Compare
[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 |
"github.com/golang/mock/gomock" | ||
csisanity "github.com/kubernetes-csi/csi-test/v5/pkg/sanity" | ||
"github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud/metadata" | ||
d "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver" |
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 creating an alias here needed?
If we really need it, let's not set it to something like d
. Short names should only be used within a small scope (like a function or loop).
func createMockObjects(mockCtrl *gomock.Controller, mountPath string) (*fakeMounter, *fakeCloud, *fakeMetadataService, *d.MockKubernetesClient) { | ||
fakeMounter := NewFakeMounter() | ||
fakeCloud := NewFakeCloud(*fakeMetadata, mountPath) | ||
fakeKubernetesClient := d.NewMockKubernetesClient(mockCtrl) |
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.
If we're removing mock objects, let's remove all of them. 😄
(I don't want to block the PR over this though)
mounts map[string]string | ||
} | ||
|
||
func NewFakeMounter() *fakeMounter { |
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.
non-blocking: if we don't need it outside of the package, we can probably make it lowercase e.g., newFakeMounter
.
} | ||
|
||
func (d *fakeCloud) CreateSnapshot(ctx context.Context, volumeID string, opts *cloud.SnapshotOptions) (*cloud.Snapshot, error) { | ||
snapshotID := fmt.Sprintf("snapshot-%d", rand.New(rand.NewSource(time.Now().UnixNano())).Uint64()) |
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.
EBS snapshots IDs start with snap-
.
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?