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

Refactor E2E: Streamline setting of CreateVolume Parameters in test-cases. #1845

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

AndrewSirenko
Copy link
Contributor

Is this a bug fix or adding new feature?
Refactor

What is this PR about? / Why do we need it?
The aws-ebs-csi-driver's E2E tests currently rely on test-specific helper-function behavior and kitchen-sink wrapper-structs (See the git-blame for the VolumeDetails). While test-specific extra helper-function-logic and wrapper-struct-fields helped increase the driver's test-coverage sooner, they negatively impact the discoverability and readability of these utility functions when writing more e2e tests.

This PR begins to standardize these disparate ways of writing e2e tests by having any test that dynamically provisions volumes rely on explicitly setting CreateVolume (StorageClass) Parameters within the test-cases.

These commits are bundled into one PR to simplify code review + CI (Prow tests + Merging).

The purposes of each commit are:

What testing is done?
All E2E tests passed locally after each commit.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 24, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 24, 2023
Copy link

Code Coverage Diff

This PR does not change the code coverage

tests/e2e/testsuites/specs.go Outdated Show resolved Hide resolved
tests/e2e/testsuites/e2e_utils.go Show resolved Hide resolved
tests/e2e/testsuites/e2e_utils.go Outdated Show resolved Hide resolved
@@ -82,6 +82,9 @@ const (
// BlockExpressKey increases the iops limit for io2 volumes to the block express limit
BlockExpressKey = "blockexpress"

// FSTypeKey configures the file system type that will be formatted during volume creation.
FSTypeKey = "csi.storage.k8s.io/fstype"
Copy link
Contributor

Choose a reason for hiding this comment

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

If this isn't used in the driver itself, it should be in the e2e package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should use it in the driver here:

klog.InfoS("\"fstype\" is deprecated, please use \"csi.storage.k8s.io/fstype\" instead")

If all other parameter keys mentioned in our docs are in constants.go I think that FSTypeKey belongs there as well. Especially because if one day we do use this key in the driver for something more substantial, we would have a duplicated constant.

Copy link
Member

@torredil torredil left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 30, 2023
Refactor E2E: Remove hidden performance parameter setting

Fixup E2E: Pre-Provisioned volumes don't use VolumeType

Fixup E2E: Pre-Provisioned defaultVolumeType typo

Refactor E2E: Standardize adding CreateVolume parameters to testcases

Refactor E2E: Generalize format_options CreateVolumeDetails helper fcn.
@ConnorJC3
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 1, 2023
@torredil
Copy link
Member

torredil commented Dec 1, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: torredil

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 1, 2023
@k8s-ci-robot k8s-ci-robot merged commit 174a90a into kubernetes-sigs:master Dec 1, 2023
8 checks passed
@AndrewSirenko AndrewSirenko deleted the E2ERefactor branch December 5, 2023 15:47
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants