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
Don't rely on contents of optional Condition fields in CSI mock test #88520
Don't rely on contents of optional Condition fields in CSI mock test #88520
Conversation
In order to promote the volume limits e2e test (from CSI Mock driver) to Conformance, we can't rely on specific output of optional Condition fields. Thus, this commit changes the test to only check the presence of the right condition and verify that the optional fields are not empty.
/assign @gnufied |
/assign @msau42 |
/sig storage |
for _, c := range pod.Status.Conditions { | ||
// Conformance tests cannot rely on specific output of optional fields (e.g., Reason | ||
// and Message) because these fields are not suject to the deprecation policy. | ||
if c.Type == v1.PodScheduled && c.Status == v1.ConditionFalse && c.Reason != "" && c.Message != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything that checks optional Condition fields, such as Reason or Message, as these may change over time (however it is reasonable to verify these fields exist or are non-empty)
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bertinatto, msau42 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 |
/hold |
This will cause false positives where test would appear to pass but may be for some other reason. Can we have 2 versions of this test? |
We can have another version of the test that's not part of conformance |
/retest |
The kubernetes/test/e2e/storage/testsuites/volumelimits.go Lines 199 to 210 in b6b494b
IMO it makes sense to have the less strict mock driver test graduated to Conformance and the stricter volumeLimits testsuite test running in the regular presubmit job. The only downside I see is that the latter is currently running in a non-required job (pull-kubernetes-e2e-gce-csi-serial), but I don't know if that's a big deal. |
/retest |
@gnufied what do you think of the hostpath test being more strict than the mock one used for conformance? |
yeah that is fine. /hold cancel |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
In order to promote the volume limits e2e test (from CSI Mock driver) to Conformance, we can't rely on specific output of optional Condition fields (e.g., Reason and Message). Thus, this PR changes the test to only check the presence of the right condition and verify that the optional fields are not empty.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: