Skip to content

Commit c634723

Browse files
Merge pull request #1155 from kuiwang02/discqe
OCPQE-31108: add disconnected support with custom prow job for migrated qe cases
2 parents d9496b7 + 7857f52 commit c634723

File tree

7 files changed

+228
-30
lines changed

7 files changed

+228
-30
lines changed

tests-extension/.openshift-tests-extension/openshift_payload_olmv0.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"name": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21418-PolarionID:25679-[OTP][Skipped:Disconnected]Cluster resource created and deleted correctly [Serial]",
3+
"name": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21418-PolarionID:25679-[OTP]Cluster resource created and deleted correctly [Serial]",
44
"originalName": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21418-PolarionID:25679-[Skipped:Disconnected]Cluster resource created and deleted correctly [Serial]",
55
"labels": {
66
"Extended": {},
@@ -34,7 +34,7 @@
3434
}
3535
},
3636
{
37-
"name": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21484-PolarionID:21532-[OTP][Skipped:Disconnected]watch special or all namespace by operator group",
37+
"name": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21484-PolarionID:21532-[OTP]watch special or all namespace by operator group",
3838
"originalName": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21484-PolarionID:21532-[Skipped:Disconnected]watch special or all namespace by operator group",
3939
"labels": {
4040
"Extended": {},
@@ -48,7 +48,7 @@
4848
"environmentSelector": {}
4949
},
5050
{
51-
"name": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:24906-[OTP][Skipped:Disconnected]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]",
51+
"name": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:24906-[OTP]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]",
5252
"originalName": "[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:24906-[Skipped:Disconnected]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]",
5353
"labels": {
5454
"Extended": {},
@@ -348,7 +348,7 @@
348348
"environmentSelector": {}
349349
},
350350
{
351-
"name": "[sig-operator][Jira:OLM] OLMv0 with multi ns PolarionID:71119-[OTP][Skipped:Disconnected]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial]",
351+
"name": "[sig-operator][Jira:OLM] OLMv0 with multi ns PolarionID:71119-[OTP]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial][Slow]",
352352
"originalName": "[sig-operator][Jira:OLM] OLMv0 with multi ns PolarionID:71119-[Skipped:Disconnected]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial]",
353353
"labels": {
354354
"Extended": {},
@@ -472,7 +472,7 @@
472472
}
473473
},
474474
{
475-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:23170-[OTP][Skipped:Disconnected]API labels should be hash",
475+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:23170-[OTP]API labels should be hash",
476476
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:23170-[Skipped:Disconnected]API labels should be hash",
477477
"labels": {
478478
"Extended": {},
@@ -486,7 +486,7 @@
486486
"environmentSelector": {}
487487
},
488488
{
489-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:20979-[OTP][Skipped:Disconnected]only one IP is generated",
489+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:20979-[OTP]only one IP is generated",
490490
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:20979-[Skipped:Disconnected]only one IP is generated",
491491
"labels": {
492492
"Extended": {},
@@ -565,7 +565,7 @@
565565
"environmentSelector": {}
566566
},
567567
{
568-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:29723-[OTP][Skipped:Disconnected]As cluster admin find abnormal status condition via components of operator resource",
568+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:29723-[OTP]As cluster admin find abnormal status condition via components of operator resource",
569569
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:29723-[Skipped:Disconnected]As cluster admin find abnormal status condition via components of operator resource",
570570
"labels": {
571571
"Extended": {},
@@ -582,7 +582,7 @@
582582
}
583583
},
584584
{
585-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:30762-[OTP][Skipped:Disconnected]installs bundles with v1 CRDs",
585+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:30762-[OTP]installs bundles with v1 CRDs",
586586
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:30762-[Skipped:Disconnected]installs bundles with v1 CRDs",
587587
"labels": {
588588
"Extended": {},
@@ -596,7 +596,7 @@
596596
"environmentSelector": {}
597597
},
598598
{
599-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:27683-[OTP][Skipped:Disconnected]InstallPlans can install from extracted bundles",
599+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:27683-[OTP]InstallPlans can install from extracted bundles",
600600
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:27683-[Skipped:Disconnected]InstallPlans can install from extracted bundles",
601601
"labels": {
602602
"Extended": {},
@@ -610,7 +610,7 @@
610610
"environmentSelector": {}
611611
},
612612
{
613-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:24513-[OTP][Skipped:Disconnected]Operator config support env only",
613+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:24513-[OTP]Operator config support env only",
614614
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:24513-[Skipped:Disconnected]Operator config support env only",
615615
"labels": {
616616
"Extended": {},
@@ -638,7 +638,7 @@
638638
"environmentSelector": {}
639639
},
640640
{
641-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:25760-[OTP][Skipped:Disconnected]Operator upgrades does not fail after change the channel",
641+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:25760-[OTP]Operator upgrades does not fail after change the channel",
642642
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:25760-[Skipped:Disconnected]Operator upgrades does not fail after change the channel",
643643
"labels": {
644644
"Extended": {},
@@ -714,7 +714,7 @@
714714
}
715715
},
716716
{
717-
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:39897-[OTP][Skipped:Disconnected]operator objects should not be recreated after all other associated resources have been deleted[Serial]",
717+
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:39897-[OTP]operator objects should not be recreated after all other associated resources have been deleted[Serial]",
718718
"originalName": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:39897-[Skipped:Disconnected]operator objects should not be recreated after all other associated resources have been deleted[Serial]",
719719
"labels": {
720720
"Extended": {},

tests-extension/test/qe/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,52 @@ All migrated test case code needs the following changes to run in the new test f
243243
- Do NOT add `[OCPFeatureGate:xxxx]` label
244244
20. **Exclusive**: change to `Serial`
245245
246+
## Disconnected Environment Support for Migrated QE cases
247+
248+
**IMPORTANT**: With IDMS/ITMS mirror configuration in place, disconnected environments work exactly like connected environments.
249+
250+
**What this means:**
251+
- Write test cases the same way you would for connected environments
252+
- Create ClusterCatalogs directly - no environment detection needed
253+
- IDMS/ITMS automatically redirects image pulls to mirror registry
254+
- No special helper functions or conditional logic required
255+
256+
**Image Requirements for Migrated QE Cases:**
257+
- All operator images (bundle, base, index) must be hosted under `quay.io/openshifttest` or `quay.io/olmqe`
258+
- This ensures images are mirrored to disconnected environments via IDMS/ITMS configuration
259+
- Images from other registries will not be available in disconnected clusters
260+
261+
**Environment Validation for Disconnected-Supporting Migrated Test Cases:**
262+
263+
**When to use `ValidateAccessEnvironment`:**
264+
265+
1. **Test cases that create CatalogSource or Subscription**:
266+
- If your test supports disconnected environments (both connected+disconnected, or disconnected-only)
267+
- AND your test creates CatalogSource or Subscription resources
268+
- **MUST** call `ValidateAccessEnvironment(oc)` at the beginning of the test
269+
- This applies to both newly created test cases and migrated test cases
270+
271+
2. **Test cases that do NOT create both CatalogSource and Subscription**:
272+
- Optional to use `ValidateAccessEnvironment(oc)`
273+
- Using it won't cause errors, but it's not required
274+
- The validation is primarily for ensuring catalog images can be mirrored
275+
276+
**Usage example:**
277+
278+
```go
279+
g.It("test case supporting disconnected", func() {
280+
olmv0util.ValidateAccessEnvironment(oc) // MUST call if creating CatalogSource/Subscription
281+
// rest of test code
282+
})
283+
```
284+
285+
**What ValidateAccessEnvironment does:**
286+
- **Proxy clusters**: Returns immediately (no validation needed, proxy provides external access)
287+
- **Connected clusters**: Returns immediately after quick network check (no validation needed)
288+
- **Disconnected clusters**: Validates that ImageTagMirrorSet `image-policy-aosqe` is configured
289+
- If ITMS is configured: Test proceeds normally
290+
- If ITMS is missing: Test is skipped with clear message explaining what's missing
291+
246292
## Test Automation Code Requirements
247293
248294
Consider these requirements when writing and reviewing code:
@@ -314,6 +360,10 @@ This ensures Claude Code has access to:
314360
315361
## Local Development Workflow
316362
363+
### Environment Configuration for Migrated QE cases
364+
365+
**IMPORTANT**: With IDMS/ITMS in place, tests work the same in both connected and disconnected environments. No special configuration is needed.
366+
317367
### Before Submitting PR
318368
319369
1. **Build and compile**:

tests-extension/test/qe/specs/olmv0_allns.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within all namespace", func()
3838
dr.RmIr(itName)
3939
})
4040

41-
g.It("PolarionID:21418-PolarionID:25679-[OTP][Skipped:Disconnected]Cluster resource created and deleted correctly [Serial]", g.Label("NonHyperShiftHOST"), g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21418-PolarionID:25679-[Skipped:Disconnected]Cluster resource created and deleted correctly [Serial]"), func() {
41+
g.It("PolarionID:21418-PolarionID:25679-[OTP]Cluster resource created and deleted correctly [Serial]", g.Label("NonHyperShiftHOST"), g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21418-PolarionID:25679-[Skipped:Disconnected]Cluster resource created and deleted correctly [Serial]"), func() {
4242
architecture.SkipArchitectures(oc, architecture.PPC64LE, architecture.S390X, architecture.MULTI)
4343
exutil.SkipBaselineCaps(oc, "None")
4444
exutil.SkipNoCapabilities(oc, "marketplace")
@@ -56,6 +56,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within all namespace", func()
5656
os.Getenv("HTTP_PROXY") != "" || os.Getenv("HTTPS_PROXY") != "" || os.Getenv("http_proxy") != "" || os.Getenv("https_proxy") != "" {
5757
g.Skip("it is not supported")
5858
}
59+
olmv0util.ValidateAccessEnvironment(oc)
5960
var (
6061
itName = g.CurrentSpecReport().FullText()
6162
buildPruningBaseDir = exutil.FixturePath("testdata", "olm")
@@ -241,9 +242,10 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within all namespace", func()
241242
olmv0util.NewCheck("expect", exutil.AsAdmin, exutil.WithoutNamespace, exutil.Compare, "Succeeded", exutil.Ok, []string{"csv", subCockroachdb.InstalledCSV, "-n", subCockroachdb.Namespace, "-o=jsonpath={.status.phase}"}).Check(oc)
242243
})
243244

244-
g.It("PolarionID:21484-PolarionID:21532-[OTP][Skipped:Disconnected]watch special or all namespace by operator group", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21484-PolarionID:21532-[Skipped:Disconnected]watch special or all namespace by operator group"), func() {
245+
g.It("PolarionID:21484-PolarionID:21532-[OTP]watch special or all namespace by operator group", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:21484-PolarionID:21532-[Skipped:Disconnected]watch special or all namespace by operator group"), func() {
245246
architecture.SkipArchitectures(oc, architecture.PPC64LE, architecture.S390X, architecture.MULTI)
246247
exutil.SkipNoCapabilities(oc, "marketplace")
248+
olmv0util.ValidateAccessEnvironment(oc)
247249
var (
248250
itName = g.CurrentSpecReport().FullText()
249251
buildPruningBaseDir = exutil.FixturePath("testdata", "olm")
@@ -321,7 +323,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within all namespace", func()
321323

322324
})
323325

324-
g.It("PolarionID:24906-[OTP][Skipped:Disconnected]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:24906-[Skipped:Disconnected]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]"), func() {
326+
g.It("PolarionID:24906-[OTP]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 within all namespace PolarionID:24906-[Skipped:Disconnected]Operators requesting cluster-scoped permission can trigger kube GC bug[Serial]"), func() {
325327
architecture.SkipArchitectures(oc, architecture.PPC64LE, architecture.S390X, architecture.MULTI)
326328
exutil.SkipBaselineCaps(oc, "None")
327329
exutil.SkipNoCapabilities(oc, "marketplace")
@@ -339,6 +341,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within all namespace", func()
339341
os.Getenv("HTTP_PROXY") != "" || os.Getenv("HTTPS_PROXY") != "" || os.Getenv("http_proxy") != "" || os.Getenv("https_proxy") != "" {
340342
g.Skip("it is not supported")
341343
}
344+
olmv0util.ValidateAccessEnvironment(oc)
342345
var (
343346
itName = g.CurrentSpecReport().FullText()
344347
buildPruningBaseDir = exutil.FixturePath("testdata", "olm")

tests-extension/test/qe/specs/olmv0_multins.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 with multi ns", func() {
115115
olmv0util.NewCheck("expect", exutil.AsAdmin, exutil.WithoutNamespace, exutil.Contain, "MultiNamespace InstallModeType not supported", exutil.Ok, []string{"csv", sub.InstalledCSV, "-n", sub.Namespace, "-o=jsonpath={.status.message}"}).Check(oc)
116116
})
117117

118-
g.It("PolarionID:71119-[OTP][Skipped:Disconnected]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial]", g.Label("NonHyperShiftHOST"), g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 with multi ns PolarionID:71119-[Skipped:Disconnected]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial]"), func() {
118+
g.It("PolarionID:71119-[OTP]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial][Slow]", g.Label("NonHyperShiftHOST"), g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 with multi ns PolarionID:71119-[Skipped:Disconnected]pod does not start for installing operator of multi-ns mode when og is in one of the ns[Serial]"), func() {
119119
exutil.SkipForSNOCluster(oc)
120120
exutil.SkipBaselineCaps(oc, "None")
121121
exutil.SkipNoCapabilities(oc, "marketplace")
@@ -132,6 +132,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 with multi ns", func() {
132132
os.Getenv("HTTP_PROXY") != "" || os.Getenv("HTTPS_PROXY") != "" || os.Getenv("http_proxy") != "" || os.Getenv("https_proxy") != "" {
133133
g.Skip("it is not supported")
134134
}
135+
olmv0util.ValidateAccessEnvironment(oc)
135136
var (
136137
itName = g.CurrentSpecReport().FullText()
137138
buildPruningBaseDir = exutil.FixturePath("testdata", "olm")

0 commit comments

Comments
 (0)