Skip to content

Commit 35711d9

Browse files
committed
UPSTREAM: <carry>: add the cases
1 parent 936be0c commit 35711d9

File tree

25 files changed

+1381
-489
lines changed

25 files changed

+1381
-489
lines changed

openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
[
2+
{
3+
"name": "[sig-olmv1][Jira:OLM] clustercatalog PolarionID:69123-[Skipped:Disconnected]Catalogd clustercatalog offer the operator content through http server",
4+
"labels": {
5+
"Extended": {},
6+
"LEVEL0": {},
7+
"NonHyperShiftHOST": {},
8+
"ReleaseGate": {}
9+
},
10+
"resources": {
11+
"isolation": {}
12+
},
13+
"source": "openshift:payload:olmv1",
14+
"lifecycle": "blocking",
15+
"environmentSelector": {
16+
"exclude": "topology==\"External\""
17+
}
18+
},
19+
{
20+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:83069-olmv1 static networkpolicy.",
21+
"labels": {
22+
"Extended": {},
23+
"NonHyperShiftHOST": {}
24+
},
25+
"resources": {
26+
"isolation": {}
27+
},
28+
"source": "openshift:payload:olmv1",
29+
"lifecycle": "informing",
30+
"environmentSelector": {
31+
"exclude": "topology==\"External\""
32+
}
33+
},
234
{
335
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 Catalogs should be installed",
436
"labels": {},

openshift/tests-extension/cmd/main.go

Lines changed: 102 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import (
1717
e "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
1818
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
1919
g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
20-
exutil "github.com/openshift/operator-framework-operator-controller/openshift/tests-extension/test/extended/util"
2120
"github.com/spf13/cobra"
2221

2322
"github.com/openshift/operator-framework-operator-controller/openshift/tests-extension/pkg/env"
2423
_ "github.com/openshift/operator-framework-operator-controller/openshift/tests-extension/test"
25-
_ "github.com/openshift/operator-framework-operator-controller/openshift/tests-extension/test/extended/olmv1qe"
24+
_ "github.com/openshift/operator-framework-operator-controller/openshift/tests-extension/test/extended/specs"
25+
exutil "github.com/openshift/operator-framework-operator-controller/openshift/tests-extension/test/extended/util"
2626
)
2727

2828
func main() {
@@ -50,50 +50,146 @@ func main() {
5050
// Contains fast, parallel-safe test cases only.
5151
// Excludes any tests labeled [Serial] or [Slow].
5252
// Note: Tests with [Serial] and [Slow] cannot run with openshift/conformance/parallel.
53+
// Note: It includes the extended cases which match the openshift-tests.
5354
ext.AddSuite(e.Suite{
5455
Name: "olmv1/parallel",
5556
Parents: []string{"openshift/conformance/parallel"},
5657
Qualifiers: []string{
57-
`!(name.contains("[Serial]") || name.contains("[Slow]"))`,
58+
`((!labels.exists(l, l=="Extended")) || (labels.exists(l, l=="Extended") && labels.exists(l, l=="ReleaseGate"))) &&
59+
!(name.contains("[Serial]") || name.contains("[Slow]"))`,
5860
},
5961
})
6062

6163
// Suite: olmv1/serial
6264
// ---------------------------------------------------------------
6365
// Contains tests explicitly labeled [Serial].
6466
// These tests are typically disruptive and must run one at a time.
67+
// Note: It includes the extended cases which match the openshift-tests.
6568
ext.AddSuite(e.Suite{
6669
Name: "olmv1/serial",
6770
Parents: []string{"openshift/conformance/serial"},
6871
Qualifiers: []string{
69-
`name.contains("[Serial]")`,
72+
`((!labels.exists(l, l=="Extended")) || (labels.exists(l, l=="Extended") && labels.exists(l, l=="ReleaseGate"))) &&
73+
(name.contains("[Serial]") && !name.contains("[Disruptive]") && !name.contains("[Slow]"))`,
74+
// refer to https://github.com/openshift/origin/blob/main/pkg/testsuites/standard_suites.go#L456
7075
},
7176
})
7277

7378
// Suite: olmv1/slow
7479
// // ---------------------------------------------------------------
7580
// Contains tests labeled [Slow], which take significant time to run.
7681
// These are not allowed in fast/parallel suites, and should run in optional/slow jobs.
82+
// Note: It includes the extended cases which match the openshift-tests.
7783
ext.AddSuite(e.Suite{
7884
Name: "olmv1/slow",
7985
Parents: []string{"openshift/optional/slow"},
8086
Qualifiers: []string{
81-
`name.contains("[Slow]")`,
87+
`((!labels.exists(l, l=="Extended")) || (labels.exists(l, l=="Extended") && labels.exists(l, l=="ReleaseGate"))) &&
88+
name.contains("[Slow]")`,
8289
},
8390
})
8491

8592
// Suite: olmv1/all
8693
// ---------------------------------------------------------------
8794
// All tests in one suite: includes [Serial], [Slow], [Disruptive], etc.
95+
// Note: It includes the extended cases which match the openshift-tests.
8896
ext.AddSuite(e.Suite{
8997
Name: "olmv1/all",
98+
Qualifiers: []string{
99+
`(!labels.exists(l, l=="Extended")) || (labels.exists(l, l=="Extended") && labels.exists(l, l=="ReleaseGate"))`,
100+
},
101+
})
102+
103+
// Extended Suite: All extended tests
104+
// Contains all extended tests migrated from tests-private repository
105+
ext.AddSuite(e.Suite{
106+
Name: "olmv1/extended",
107+
Qualifiers: []string{
108+
`labels.exists(l, l=="Extended")`,
109+
},
110+
})
111+
112+
// Extended ReleaseGate Suite: extended tests that meet OpenShift CI requirements
113+
// Contains extended tests marked as release gate for openshift-tests
114+
ext.AddSuite(e.Suite{
115+
Name: "olmv1/extended/releasegate",
116+
Qualifiers: []string{
117+
`labels.exists(l, l=="Extended") && labels.exists(l, l=="ReleaseGate")`,
118+
},
119+
})
120+
121+
// Extended Candidate Suite: Extended tests that don't meet OpenShift CI requirements
122+
// Contains extended tests that are not for openshift-tests (run in custom periodic jobs only)
123+
ext.AddSuite(e.Suite{
124+
Name: "olmv1/extended/candidate",
125+
Qualifiers: []string{
126+
`labels.exists(l, l=="Extended") && !labels.exists(l, l=="ReleaseGate")`,
127+
},
128+
})
129+
130+
// Extended Candidate Suite Parallel Suite: extended tests that can run in parallel
131+
// Contains extended tests that can run concurrently (excludes Serial, Slow, and StressTest)
132+
ext.AddSuite(e.Suite{
133+
Name: "olmv1/extended/candidate/parallel",
134+
Qualifiers: []string{
135+
`(labels.exists(l, l=="Extended") && !labels.exists(l, l=="ReleaseGate") && !labels.exists(l, l=="StressTest")) &&
136+
!(name.contains("[Serial]") || name.contains("[Slow]"))`,
137+
},
138+
})
139+
// Extended Candidate Serial Suite: extended tests that must run one at a time
140+
// Contains extended tests marked as [Serial] (includes Disruptive tests since not used for openshift-tests)
141+
ext.AddSuite(e.Suite{
142+
Name: "olmv1/extended/candidate/serial",
143+
Qualifiers: []string{
144+
`(labels.exists(l, l=="Extended") && !labels.exists(l, l=="ReleaseGate") && !labels.exists(l, l=="StressTest")) &&
145+
(name.contains("[Serial]") && !name.contains("[Slow]"))`,
146+
// it is not used for openshift-tests, so it does not exclude Disruptive, so that we could use
147+
// olmv1/extended/candidate/serial to run all serial case including Disruptive cases
148+
},
149+
})
150+
// Extended Candidate Slow Suite: extended tests that take significant time to run
151+
// Contains extended tests marked as [Slow] (long-running tests not suitable for fast CI)
152+
ext.AddSuite(e.Suite{
153+
Name: "olmv1/extended/candidate/slow",
154+
Qualifiers: []string{
155+
`(labels.exists(l, l=="Extended") && !labels.exists(l, l=="ReleaseGate") && !labels.exists(l, l=="StressTest")) &&
156+
name.contains("[Slow]")`,
157+
},
158+
})
159+
// Extended Candidate Stress Suite: extended stress tests
160+
// Contains extended tests designed for stress testing and resource exhaustion scenarios
161+
ext.AddSuite(e.Suite{
162+
Name: "olmv1/extended/candidate/stress",
163+
Qualifiers: []string{
164+
`labels.exists(l, l=="Extended") && !labels.exists(l, l=="ReleaseGate") && labels.exists(l, l=="StressTest")`,
165+
},
90166
})
91167

92168
specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
93169
if err != nil {
94170
panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error()))
95171
}
96172

173+
// Automatically identify and label extended tests: select all tests from the specs directory and add the "Extended" label
174+
specs.Select(exutil.Olmv1QeTestsOnly()).AddLabel("Extended")
175+
// Process all test specs to apply extended-specific transformations and topology exclusions
176+
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
177+
if spec.Labels.Has("Extended") {
178+
// Change blocking tests to informing unless marked as ReleaseGate
179+
if !spec.Labels.Has("ReleaseGate") && spec.Lifecycle == "blocking" {
180+
spec.Lifecycle = "informing"
181+
}
182+
// Exclude External topology for NonHyperShiftHOST tests
183+
if spec.Labels.Has("NonHyperShiftHOST") {
184+
spec.Exclude(et.TopologyEquals("External"))
185+
}
186+
// Include External Connecttivity for Disconnected only tests
187+
if strings.Contains(spec.Name, "[Skipped:Connected]") {
188+
spec.Include(et.ExternalConnectivityEquals("Disconnected"))
189+
}
190+
}
191+
})
192+
97193
// Ensure `[Disruptive]` tests are always also marked `[Serial]`.
98194
// This prevents them from running in parallel suites, which could cause flaky failures
99195
// due to disruptive behavior.
@@ -142,7 +238,7 @@ func main() {
142238
// Initialize the environment before running any tests.
143239
specs.AddBeforeAll(func() {
144240
env.Init()
145-
exutil.InitCLusterEnv()
241+
exutil.InitClusterEnv()
146242
})
147243

148244
ext.AddSpecs(specs)

0 commit comments

Comments
 (0)