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

e2e storage tests: usable out-of-tree #70862

Merged
merged 5 commits into from Dec 22, 2018

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Nov 9, 2018

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Not all CSI drivers can be tested in Kubernetes (they might not be open) or should not be (if it does not help develop and enhance Kubernetes). Therefore it is useful to make the tests available to out-of-tree drivers without pulling in Kubernetes E2E specific code and tests.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 9, 2018
@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 9, 2018
@pohly
Copy link
Contributor Author

pohly commented Nov 9, 2018

/test pull-kubernetes-e2e-gce-100-performance

@pohly
Copy link
Contributor Author

pohly commented Nov 9, 2018

/hold

I am still testing this myself...

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2018
@pohly pohly force-pushed the e2e-storage-tests branch 3 times, most recently from af7cd36 to 7da9de2 Compare November 9, 2018 17:40
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 9, 2018
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 9, 2018
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 9, 2018
@pohly pohly force-pushed the e2e-storage-tests branch 2 times, most recently from f2f3b55 to bf39135 Compare November 12, 2018 12:22
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 12, 2018
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 20, 2018
@pohly
Copy link
Contributor Author

pohly commented Dec 20, 2018

I had to rebase because my other PR for the image versions changed the .yaml files.

@verult can you re-add your lgtm or
@msau42 can you lgtm+approve?

@verult
Copy link
Contributor

verult commented Dec 20, 2018

/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 20, 2018
Exposing framework.VolumeTestConfig as part of the testsuite package
API was confusing because it was unclear which of the values in it
really have an effect. How it was set also was a bit awkward: a test
driver had a copy that had to be overwritten at test runtime and then
might have been updated and/or overwritten again by the driver.

Now testsuites has its own test config structure. It contains the
values that might have to be set dynamically at runtime. Instead of
overwriting a copy of that struct inside the test driver, the test
driver takes some common defaults (specifically, the framework pointer
and the prefix) when it gets initialized and then manages its own
copy. For example, the hostpath driver has to lock the pods to a
single node.

framework.VolumeTestConfig is still used internally and test drivers
can decide to run tests with a fully populated instance if needed (for
example, after setting up an NFS server).
Generated via hack/update-bazel.sh.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2018
@pohly
Copy link
Contributor Author

pohly commented Dec 21, 2018

@msau42 I took the enhancements for multiple nodes out of this PR and re-implemented that in #72002. That PR is now a bit bigger than it needs to be, let me know if you want me to split it up.

Please have another look at the remaining code in this PR.

@pohly
Copy link
Contributor Author

pohly commented Dec 21, 2018

/test pull-kubernetes-integration

@liggitt
Copy link
Member

liggitt commented Dec 21, 2018

linking PR's that had a test flake because of #71696

cs := f.ClientSet
ns := f.Namespace
n.externalPluginName = fmt.Sprintf("example.com/nfs-%s", ns.Name)

// Reset config. It might have been modified by a previous CreateVolume call.
Copy link
Member

Choose a reason for hiding this comment

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

Tests can run in parallel. Does each test case get it's own unique object, or share the same object? If each test case has a new object, then this is not needed. If they share the same object, then this may not work very well.

Copy link
Member

Choose a reason for hiding this comment

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

Opened up #72288 to consider refactoring this later. I don't think this is a clean abstraction

@pohly
Copy link
Contributor Author

pohly commented Dec 21, 2018 via email

@msau42
Copy link
Member

msau42 commented Dec 21, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: msau42, pohly

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 21, 2018
@msau42
Copy link
Member

msau42 commented Dec 21, 2018

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 21, 2018
@k8s-ci-robot k8s-ci-robot merged commit e3bf5db into kubernetes:master Dec 22, 2018
pohly added a commit to pohly/kubernetes that referenced this pull request Dec 28, 2018
PR kubernetes#70862 made each driver responsible for resetting its config, but
as it turned out, one place was missed in that PR: the in-tree gcepd
sets a node selector. Not resetting that caused other tests to fail
randomly depending on test execution order.

Now the test suite resets the config by taking a copy after setting up
the driver and restoring that copy before each test.

Long term the intention is to separate the entire test config from the
static driver info (kubernetes#72288),
but for now resetting the config is the fastest way to fix the test flake.

Fixes: kubernetes#72378
pohly added a commit to intel/oim that referenced this pull request Feb 8, 2019
The entire volume testing has been refactored upstream. Instead of
just one provisioning test for CSI, the full range of tests that were
previously only available for in-tree volume drivers can now also be
used for CSI.

With some pending
modifications (kubernetes/kubernetes#70862)
these tests can also be used out-of-tree and replace the locally
modified copy of the provisioning test.

The downside is the long runtime.
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants