Bug 1945091: Refactor openshift-tests a bit, add more network-test-autodetecting support#25818
Conversation
f675869 to
1575c88
Compare
|
/retest |
|
/lgtm This looks fine to me, and I appreciate the testing you've added. Any reason not to unskip in o/k first and vendor that change as part of this PR to get some test signal? Any change to o/k will have to be vendored to origin to take effect. |
1575c88 to
47477cd
Compare
Filed that PR now, openshift/kubernetes#565. But that shouldn't merge until after this does since if it got vendored before this PR merged it would cause tests to be unskipped that shouldn't be unskipped (eg running dual-stack tests in single-stack clusters). But also, this PR is mostly just a prereq; we still have to fix KNIDEPLOY-4090 to get the IPv6/dual-stack tests to actually run, and we still have to create a new job (or modify some existing one) to get the SCTP tests to run. |
|
/hold |
22aa7b6 to
47477cd
Compare
|
/retest |
|
/hold cancel |
| skips = append(skips, "[Feature:Networking-IPv4]") | ||
| } | ||
| if !c.HasIPv6 { | ||
| skips = append(skips, "[Feature:Networking-IPv6]") |
There was a problem hiding this comment.
just FYI these tags are not longer upstream, tests must work on both IP families (depend on the cluster configuration), there is only one test remaining that I couldn't migrate
grep -r Networking test | grep Fea
test/e2e/network/networking_perf.go:var _ = SIGDescribe("Networking IPerf2 [Feature:Networking-Performance]", func() {
test/e2e/network/networking.go: ginkgo.It("should provide Internet connection for containers [Feature:Networkin-IPv4]", func() {
test/e2e/network/networking.go: ginkgo.It("should provide Internet connection for containers [Feature:Networkin-IPv6][Experimental][LinuxOnly]", func() {
There was a problem hiding this comment.
heh, I just realise the tag is wrong Networkin/Networking
cmd/openshift-tests/provider.go
Outdated
| if len(providerInfo.Type) == 0 { | ||
| return nil, fmt.Errorf("provider must be a JSON object with the 'type' key") | ||
| } | ||
| var cloudConfig e2e.CloudConfig |
There was a problem hiding this comment.
Doing this would mean we have to be backwards compatible forever in upstream test context (the config for a step is ignorant of the version of openshift it’s testing). If upstream changes the struct in a non backwards compatible way the rebase will require all the test steps/config in CI to be forked).
I’m not opposed to the change in theory but I’d want some evidence we have a way that is not “openshift-tests api surface to CI changes” before moving forward.
There was a problem hiding this comment.
No, it's the other way around; currently we expose the upstream API in our API. After this PR we do not.
That is, before this commit we do:
- unmarshal
providerinto ane2e.CloudConfig - copy the
e2e.CloudConfiginto anexutilcluster.ClusterConfigelement-by-element - later, copy the
exutilcluster.ClusterConfigback into ane2e.CloudConfig, element-by-element, for the tests to use (https://github.com/openshift/origin/blob/ff70d2d5/cmd/openshift-tests/provider.go#L31)
after this PR we do:
- unmarshal
providerinto anexutilcluster.ClusterConfig - later, copy the
exutilcluster.ClusterConfiginto ane2e.CloudConfig, element-by-element
There was a problem hiding this comment.
We're backward compatible on the json format all the way back to 4.1 still, right?
There was a problem hiding this comment.
Yes. The JSON-parsing unit test is added in the first commit, and none of the input values of those tests is changed after that. (The output values change slightly to reflect two bugfixes: we now correctly set the default vales of NumNodes and MultiMaster even on bare metal; and we no longer ignore the MultiMaster and MultiZone fields in the input JSON if it's trying to override them.)
If you want to add additional examples from openshift/release to the unit tests I can do that
|
A few concerns on individual commits. |
47477cd to
6910026
Compare
It already contains non-cloud-specific network info, and will soon contain more.
We shouldn't avoid detecting NumNodes and MultiMaster just because Platform is None.
When the user passes "--provider <JSON-VALUE>", rather than reading it into an e2e.CloudConfig, autodetecting the exutilcluster.ClusterConfig, and then merging the two structs together field by field, just do the autodetection first, and then unmarshal the JSON directly into the ClusterConfig (possibly overwriting some of the autodetected values). In addition to being simpler, this allows for overriding the networking-related values that are in ClusterConfig but not CloudConfig.
Redo "NetworkPluginIDs" as "NetworkPlugin" and "NetworkPluginMode", which make more sense as part of a visible API.
(For now we can't actually autodetect whether SCTP is available, but a test job could set HasSCTP via JSON --provider.)
8f4c7ae to
6d7e8dc
Compare
|
/retest |
4 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, marun, smarterclayton The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@danwinship: All pull requests linked via external trackers have merged: Bugzilla bug 1945091 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Currently we are unconditionally skipping all single-stack-IPv6, dual-stack, and SCTP tests, regardless of cluster configuration. This is no good.
This PR extends the existing network-plugin-detection code to also detect network IP configuration and automatically skip IPv4-only, IPv6-only, and dual-stack-only tests as appropriate.
It also kind of adds support for detecting and skipping SCTP tests, except we can't really easily detect whether SCTP is available in the cluster at this point, so in reality it only works if you manually override the SCTP detection via
--provider/TEST_PROVIDER. But we might be able to improve on that in the future. (And being able to unskip the SCTP tests at all is an improvement over the current situation.)This will require a followup PR to openshift/kubernetes to stop skipping these tags. Thus, for the moment, this PR should have no effect on the tests that actually get run.
Also, until https://issues.redhat.com/browse/KNIDEPLOY-4090 is fixed, the
e2e-metal-ipi-ovn-ipv6ande2e-metal-ipi-ovn-dualstacksuites won't actually run any of the "fun" test cases anyway...