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

storage/etcd3: continue unifying test setup #109618

Conversation

stevekuznetsov
Copy link
Contributor

@stevekuznetsov stevekuznetsov commented Apr 22, 2022

storage/etcd3: continue unifying test setup

Previous work by liggitt in 0176092 improved the boilerplate
required to run an embedded etcd server for tests as well as set up the
*etcd3.store{} for testing. A number of tests were not ported to use the
new helpers, though, either due to custom setup or due to inconsistent
use of setup options. A follow-up by stevekuznetsov in 6aa37eb
removed much of the inconsistency, meaning that most callers to
newStore() were simply using the default boilerplate and options that
testSetup() used.

This patch moves all users to testSetup(), adding options as necessary
to enable some fringe setup use-cases. With a unified setup, new tests
will not copy boilerplate they do not need and it will be immediately
obvious when reading a test if the client or storage setup is not
default, improving readability.

Signed-off-by: Steve Kuznetsov skuznets@redhat.com


/kind cleanup

NONE

/assign @wojtek-t
/cc @liggitt

@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.24 branch. This means every merged PR has to be cherry-picked into the release branch to be part of the upcoming v1.24.0 release.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Apr 22, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 22, 2022
@stevekuznetsov stevekuznetsov force-pushed the skuznets/common-storage-test-setup branch from f3507bf to d6c02ab Compare April 22, 2022 14:49
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 22, 2022
@stevekuznetsov
Copy link
Contributor Author

/sig api-machinery

@stevekuznetsov
Copy link
Contributor Author

 === Failed
=== FAIL: pkg/controller/volume/attachdetach/reconciler Test_Run_OneVolumeDetachFailNodeWithReadWriteOnce (1.10s)
W0422 15:03:57.461091   54498 mutation_detector.go:53] Mutation detector is enabled, this will result in memory leakage.
I0422 15:03:57.461881   54498 operation_generator.go:398] AttachVolume.Attach succeeded for volume "volume-name" (UniqueName: "fake-plugin/volume-name") from node "fail-detach-node" 
...
    reconciler_test.go:1448: Check volume <fake-plugin/volume-name> is reported as attached to node <fail-detach-node>, got false, expected true 

flake
/retest

Copy link
Member

@wojtek-t wojtek-t left a comment

Choose a reason for hiding this comment

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

Couple small comments - but overall this LGTM

@stevekuznetsov
Copy link
Contributor Author

@wojtek-t thanks for the review! Updated

@stevekuznetsov stevekuznetsov force-pushed the skuznets/common-storage-test-setup branch 2 times, most recently from b5f8865 to aec5853 Compare April 25, 2022 15:07
@stevekuznetsov
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind

@stevekuznetsov stevekuznetsov force-pushed the skuznets/common-storage-test-setup branch from aec5853 to 9160626 Compare April 25, 2022 20:49
@stevekuznetsov
Copy link
Contributor Author

@wojtek-t couldn't remove withTransformer() itself since the fancyTransformer{} test requires it

@stevekuznetsov
Copy link
Contributor Author

/test pull-kubernetes-node-e2e-containerd

Copy link
Member

@wojtek-t wojtek-t left a comment

Choose a reason for hiding this comment

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

This is great - I just have one nit comment.

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2022
Previous work by liggitt in 0176092 improved the boilerplate
required to run an embedded etcd server for tests as well as set up the
`*etcd3.store{}` for testing. A number of tests were not ported to use the
new helpers, though, either due to custom setup or due to inconsistent
use of setup options. A follow-up by stevekuznetsov in 6aa37eb
removed much of the inconsistency, meaning that most callers to
`newStore()` were simply using the default boilerplate and options that
`testSetup()` used.

This patch moves all users to testSetup(), adding options as necessary
to enable some fringe setup use-cases. With a unified setup, new tests
will not copy boilerplate they do not need and it will be immediately
obvious when reading a test if the client or storage setup is *not*
default, improving readability.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
@stevekuznetsov
Copy link
Contributor Author

@wojtek-t updated to do a hard cast

@stevekuznetsov stevekuznetsov force-pushed the skuznets/common-storage-test-setup branch from 9160626 to 138faa3 Compare April 26, 2022 19:26
@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 26, 2022
@wojtek-t
Copy link
Member

/lgtm
/approve

Thanks!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stevekuznetsov, wojtek-t

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 merged commit ebd5c8c into kubernetes:master May 4, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone May 4, 2022
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. area/apiserver 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants