Skip to content
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

Enable CSI sanity/conformance tests #1850

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

torredil
Copy link
Member

@torredil torredil commented Dec 4, 2023

What is this PR about? / Why do we need it?

This PR enables csi-sanity / conformance tests, which are meant to test the CSI API capability of a driver. They are meant to be an additional test to the unit, functional, and e2e tests of a CSI driver.

The following 3 tests fail:

  • [Fail] Node Service NodeExpandVolume [It] should fail when volume is not found /home/go/pkg/mod/github.com/kubernetes-csi/csi-test/[email protected]/pkg/sanity/node.go:786

  • [Fail] Node Service NodeExpandVolume [It] should work if node-expand is called after node-publish /home/go/pkg/mod/github.com/kubernetes-csi/csi-test/[email protected]/pkg/sanity/node.go:837

  • [Fail] Node Service [It] should work /home/go/pkg/mod/github.com/kubernetes-csi/csi-test/[email protected]/pkg/sanity/node.go:177

Due to

func (d *nodeService) IsBlockDevice(fullPath string) (bool, error) {

incorrectly being part of the node service. In doing this work, I realized that our node service needs to be revisited as there is logic specific to the mounter interface that has made its way into the node service which really needs decoupling.

Ideally, we should be able to make use of NewFakeMounter from mount-utils. However, this is currently not possible as we implement a custom Mounter interface that is a mix & match of functions defined in the upstream library.

What testing is done?

$ make test-sanity

Ran 67 of 78 Specs in 4.073 seconds
FAIL! -- 64 Passed | 3 Failed | 1 Pending | 10 Skipped

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 4, 2023
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 4, 2023
@torredil torredil force-pushed the sanity-tests branch 4 times, most recently from 1708ad2 to 4449619 Compare December 4, 2023 16:21
Copy link

github-actions bot commented Dec 4, 2023

Code Coverage Diff

File Old Coverage New Coverage Delta
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver/controller.go 86.0% 83.8% -2.1
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver/driver.go 63.6% 31.9% -31.8
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver/identity.go 37.5% 0.0% -37.5
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver/mount.go 71.4% 42.9% -28.6
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver/node.go 80.0% 79.5% -0.5

Copy link
Contributor

@AndrewSirenko AndrewSirenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a mix of nits, requests, and out-of-scope comments. LGTMing because this PR is a two-way-door and requested changes are not blocking.

tests/sanity/sanity_test.go Outdated Show resolved Hide resolved
@@ -150,8 +150,7 @@ test:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding test-sanity as dependency for make test once we fix these 3 broken tests. These sanity tests are unit-tests (no external dependencies), therefore they finish (almost) instantly. Contributors would also self-service csi-spec gotchas more easily. (Not sure a contributor would remember to run make test-sanity but they would hopefully be running make test)

tests/sanity/sanity_test.go Show resolved Hide resolved
tests/sanity/sanity_test.go Outdated Show resolved Hide resolved
tests/sanity/sanity_test.go Outdated Show resolved Hide resolved
tests/sanity/sanity_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 5, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 5, 2023
Makefile Outdated Show resolved Hide resolved
pkg/driver/driver.go Outdated Show resolved Hide resolved
tests/sanity/sanity_test.go Show resolved Hide resolved
tests/sanity/sanity_test.go Show resolved Hide resolved
tests/sanity/sanity_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 6, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2023
@ConnorJC3
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ConnorJC3

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2023
@torredil
Copy link
Member Author

torredil commented Dec 7, 2023

/test pull-aws-ebs-csi-driver-verify

@k8s-ci-robot k8s-ci-robot merged commit a83fbd1 into kubernetes-sigs:master Dec 7, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants