22========================
33
44This repository contains the OLMv1 tests for OpenShift.
5- These tests run against OpenShift clusters and are meant to be used in the OpenShift CI/CD pipeline.
5+ These tests are designed to run exclusively on OpenShift clusters and are used in the OpenShift CI/CD pipeline.
66They use the framework: https://github.com/openshift-eng/openshift-tests-extension
77
88## How it works
@@ -117,8 +117,8 @@ Example ([source](https://github.com/openshift/release/blob/main/ci-operator/con
117117
118118# # How to Run the Tests Locally
119119
120- The tests can be run locally using the `olmv1-tests-ext` binary against an OpenShift cluster or a vanilla Kubernetes cluster .
121- Features and checks which are OpenShift-specific will be skipped when running against a vanilla Kubernetes cluster .
120+ The tests can be run locally using the `olmv1-tests-ext` binary against an OpenShift cluster.
121+ These tests are specifically designed for OpenShift and require OpenShift-specific APIs and features .
122122
123123Use the environment variable `KUBECONFIG` to point to your cluster configuration file such as :
124124
@@ -127,9 +127,9 @@ KUBECONFIG=path/to/kubeconfig ./bin/olmv1-tests-ext run-test -n <test-name>
127127` ` `
128128
129129To run tests that include tech preview features,
130- you need a cluster with OLMv1 installed and those features enabled.
130+ you need an OpenShift cluster with OLMv1 installed and those features enabled.
131131
132- # ## Local Test using OLMv1 and OCP
132+ # ## Local Test using OLMv1 on OpenShift
133133
1341341. Use the `Cluster Bot` to create an OpenShift cluster with OLMv1 installed.
135135
@@ -155,99 +155,6 @@ export KUBECONFIG=~/.kube/cluster-bot.kubeconfig
155155./bin/olmv1-tests-ext run-suite olmv1/all
156156` ` `
157157
158- # ## Local Test using OLMv1 and Kind
159-
160- **Prerequisites:**
161-
162- Install OLMv1 before running the tests.
163- You can use the `kind` tool to create a local Kubernetes cluster with OLMv1 installed.
164- Furthermore, if you are using feature gates in your test you will need to
165- ensure that those are enabled in your cluster.
166-
167- **Example:**
168-
169- export KUBECONFIG=$HOME/.kube/config
170-
171- ` ` ` shell
172- $ ./bin/olmv1-tests-ext run-suite olmv1/all
173- Running Suite: - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
174- ===============================================================================================================
175- Random Seed: 1753508546 - will randomize all specs
176-
177- Will run 1 of 1 specs
178- ------------------------------
179- [sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should verify required CRDs are installed and active
180- /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:37
181- [INFO] [env] Using kubeconfig: /Users/camilam/.kube/config[WARN] Skipping feature capability check: not OpenShift STEP: verifying CRD clusterextensions.olm.operatorframework.io @ 07/26/25 06:42:26.57
182- STEP: verifying CRD clustercatalogs.olm.operatorframework.io @ 07/26/25 06:42:26.575
183- • [0.026 seconds]
184- ------------------------------
185-
186- Ran 1 of 1 Specs in 0.026 seconds
187- SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
188- Running Suite: - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
189- ===============================================================================================================
190- Random Seed: 1753508546 - will randomize all specs
191-
192- Will run 1 of 1 specs
193- ------------------------------
194- [sig-olmv1] OLMv1 should pass a trivial sanity check
195- /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:26
196- • [0.000 seconds]
197- ------------------------------
198-
199- Ran 1 of 1 Specs in 0.000 seconds
200- SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
201- [
202- {
203- "name": "[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should verify required CRDs are installed and active",
204- "lifecycle": "blocking",
205- "duration": 26,
206- "startTime": "2025-07-26 05:42:26.553886 UTC",
207- "endTime": "2025-07-26 05:42:26.580057 UTC",
208- "result": "passed",
209- "output": "[INFO] [env] Using kubeconfig: /Users/camilam/.kube/config[WARN] Skipping feature capability check: not OpenShift STEP: verifying CRD clusterextensions.olm.operatorframework.io @ 07/26/25 06:42:26.57\n STEP: verifying CRD clustercatalogs.olm.operatorframework.io @ 07/26/25 06:42:26.575\n "
210- },
211- {
212- "name": "[sig-olmv1] OLMv1 should pass a trivial sanity check",
213- "lifecycle": "blocking",
214- "duration": 26,
215- "startTime": "2025-07-26 05:42:26.553852 UTC",
216- "endTime": "2025-07-26 05:42:26.580263 UTC",
217- "result": "passed",
218- "output": ""
219- }
220- ]
221- ` ` `
222-
223- # # Writing Tests
224-
225- You can write tests in the `openshift/tests-extension/tests/` directory.
226- Please follow these guidelines :
227-
228- 1. Skip OpenShift-specific logic on vanilla Kubernetes
229-
230- If your test requires OpenShift-only APIs (e.g., clusterversions.config.openshift.io),
231- guard it using `env.Get().IsOpenShift` to ensure it skips gracefully when running
232- on vanilla Kubernetes clusters :
233-
234- ` ` ` go
235- if !env.Get().IsOpenShift {
236- extlogs.Warn("Skipping test: not running on OpenShift")
237- Skip("This test requires OpenShift APIs")
238- }
239- ` ` `
240-
241- Or, if used within helper functions :
242- ` ` ` go
243- if !env.Get().IsOpenShift {
244- extlogs.Warn("Skipping feature capability check: not OpenShift")
245- return
246- }
247- ` ` `
248-
249- This ensures compatibility when running tests in non-OpenShift environments such as KinD.
250-
251158# # Development Workflow
252159
253160- Add or update tests in : ` openshift/tests-extension/tests/`
0 commit comments