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

Distinguish projected secret, configmap and downward api tests #68910

Merged
merged 4 commits into from
Oct 13, 2018

Conversation

msau42
Copy link
Member

@msau42 msau42 commented Sep 20, 2018

What this PR does / why we need it:

  • Split up projected.go into multiple files: projected_secret/configmap/downwardapi/combined.go
  • Added separate Context() with secret, configmap and downward api for projected tests.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #68904

Special notes for your reviewer:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 20, 2018
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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 Sep 20, 2018
@msau42
Copy link
Member Author

msau42 commented Sep 20, 2018

Ok, the diff looks ridiculous, but all I did was add 3 Context() blocks!

@msau42
Copy link
Member Author

msau42 commented Sep 20, 2018

/assign @BenTheElder

test/e2e/common/projected.go: "should be consumable from pods in volume"
test/e2e/common/projected.go: "should be consumable from pods in volume with defaultMode set"
test/e2e/common/projected.go: "should be consumable from pods in volume as non-root"
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings"
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings and Item mode set"
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings as non-root"
test/e2e/common/projected.go: "updates should be reflected in volume"
test/e2e/common/projected.go: "optional updates should be reflected in volume"
test/e2e/common/projected.go: "configMap with updates should be reflected in volume"
Copy link
Member Author

Choose a reason for hiding this comment

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

oops

@BenTheElder
Copy link
Member

Thank you! cc @spiffxp

@@ -112,15 +112,15 @@ test/e2e/common/projected.go: "should be consumable from pods in volume as non-r
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings"
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings and Item Mode set"
test/e2e/common/projected.go: "should be consumable in multiple volumes in a pod"
test/e2e/common/projected.go: "optional updates should be reflected in volume"
test/e2e/common/projected.go: "updates should be reflected in volume"
test/e2e/common/projected.go: "should be consumable from pods in volume"
test/e2e/common/projected.go: "should be consumable from pods in volume with defaultMode set"
test/e2e/common/projected.go: "should be consumable from pods in volume as non-root"
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings"
Copy link
Member

Choose a reason for hiding this comment

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

this one is still duplicated AFAICT (see line 112 currently)

Copy link
Member Author

Choose a reason for hiding this comment

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

I made the full test case name unique, by adding in another Context(). However, the string inside the It() is still duplicated.

Do we need the It() strings to be unique?

Copy link
Member Author

Choose a reason for hiding this comment

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

the other option I could do is to split out the tests into 3 different files: projected_secret, projected_configmap, projected_downwardapi

Copy link
Member

Choose a reason for hiding this comment

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

The full identifier needs to be unique, as long as that's the case. I think you're right and that this will already work but it might be worth splitting up anyhow?

@@ -112,15 +112,15 @@ test/e2e/common/projected.go: "should be consumable from pods in volume as non-r
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings"
test/e2e/common/projected.go: "should be consumable from pods in volume with mappings and Item Mode set"
test/e2e/common/projected.go: "should be consumable in multiple volumes in a pod"
test/e2e/common/projected.go: "optional updates should be reflected in volume"
test/e2e/common/projected.go: "updates should be reflected in volume"
test/e2e/common/projected.go: "should be consumable from pods in volume"
test/e2e/common/projected.go: "should be consumable from pods in volume with defaultMode set"
Copy link
Member

Choose a reason for hiding this comment

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

this one as well (see line 110 currently)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok after splitting them into separate files, I am still seeing some duplicates. So far it looks like at least one of the duplicate tests is a superset of the other. Can I remove conformance tests?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what the rules for removing conformance tests are, They're expected to not change post-release but I'm not sure about during a release.

@spiffxp might be able to comment on this.

Copy link
Member

Choose a reason for hiding this comment

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

er and yeah splitting the files wouldn't be enough I think, they'd need split-file-matching contexts I think? the generated [sig-storage] Projected should be consumable from pods in volume with mappings [NodeConformance] [Conformance] entry needs to be unique

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the top level Describe() of each new file to be unique

Copy link
Member

Choose a reason for hiding this comment

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

maybe we need to update the walker that generates this list, it strips out a lot

Testname: Projected Volume, ConfigMap, update
Description: A Pod is created with projected volume source ‘ConfigMap’ to store a configMap and performs a create and update to new value. Pod MUST be able to create the configMap with value-1. Pod MUST be able to update the value in the confgiMap to value-2.
*/
framework.ConformanceIt("updates should be reflected in volume [NodeConformance]", func() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is a subset of the next test. I think we can remove this test.

Copy link
Member Author

Choose a reason for hiding this comment

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

@spiffxp is it ok if I remove this test from the conformance suite (and all suites in general)?

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Contributor

Choose a reason for hiding this comment

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

So optional and non optional projected volumes have exactly the same behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I didn't realize there was actually an Optional field in the API. I will add the test back. Maybe we should add one more test case to test pod failure when optional == false

Copy link
Member Author

Choose a reason for hiding this comment

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

One more observation: non-optional is not tested for secrets either. So some future areas to improve coverage:

  • non-optional for secrets
  • non-optional should fail for secrets when key doesn't exist
  • non-optional should fail for configmaps when key doesn't exist

@msau42 msau42 force-pushed the fix-names branch 2 times, most recently from 47775da to e4ed54f Compare September 21, 2018 01:07
@spiffxp
Copy link
Member

spiffxp commented Sep 21, 2018

/area conformance

@k8s-ci-robot k8s-ci-robot added the area/conformance Issues or PRs related to kubernetes conformance tests label Sep 21, 2018
@spiffxp
Copy link
Member

spiffxp commented Sep 21, 2018

/kind cleanup
/priority important-soon

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Sep 21, 2018
@spiffxp
Copy link
Member

spiffxp commented Sep 21, 2018

/retest

@msau42
Copy link
Member Author

msau42 commented Sep 21, 2018

Updated and squashed:

  • Separated out tests into projected_configmap, projected_secret, projected_downwardapi
  • Removed one duplicate projected_configmap test

@BenTheElder
Copy link
Member

Thanks so much for looking at this! Fixing this will make it viable to get ~correct results faster by running the conformance suite first in parallel for non-[Serial] and then in serial for the handful of serial tests.

@msau42
Copy link
Member Author

msau42 commented Sep 27, 2018

this is ready for review. PTAL @spiffxp

@spiffxp
Copy link
Member

spiffxp commented Oct 4, 2018

/milestone v1.13
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 4, 2018
@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Oct 4, 2018
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 9, 2018
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 9, 2018
@msau42
Copy link
Member Author

msau42 commented Oct 9, 2018

/test pull-kubernetes-integration

@msau42
Copy link
Member Author

msau42 commented Oct 9, 2018

Put the non-optional update configmap test case back.

So this PR is strictly:

  • split up projected.go file into each volume type
  • rename test suite with the specific volume type to avoid duplicate test case names

@msau42
Copy link
Member Author

msau42 commented Oct 9, 2018

/test pull-kubernetes-integration

@spiffxp
Copy link
Member

spiffxp commented Oct 9, 2018

/retest
... weird, why are there two different commit shas in those failure links

@msau42
Copy link
Member Author

msau42 commented Oct 9, 2018

/retest

2 similar comments
@msau42
Copy link
Member Author

msau42 commented Oct 10, 2018

/retest

@spiffxp
Copy link
Member

spiffxp commented Oct 10, 2018

/retest

@smarterclayton
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Oct 12, 2018
@msau42
Copy link
Member Author

msau42 commented Oct 13, 2018

ping @spiffxp for review again

@spiffxp
Copy link
Member

spiffxp commented Oct 13, 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 Oct 13, 2018
@k8s-ci-robot k8s-ci-robot merged commit 79869af into kubernetes:master Oct 13, 2018
@msau42 msau42 deleted the fix-names branch November 17, 2018 21:08
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/conformance Issues or PRs related to kubernetes conformance tests 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.

conformance tests should have unique names
6 participants