Skip to content

Commit 62a22c1

Browse files
Merge pull request #745 from DavidRajnoha/cypress-readme-configuration-scenarios
NO-JIRA: Add test configuration scenarios overview
2 parents 7bcbe86 + 6a75bb4 commit 62a22c1

1 file changed

Lines changed: 40 additions & 84 deletions

File tree

web/cypress/README.md

Lines changed: 40 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,33 @@ Creates `export-env.sh` that you can source later: `source export-env.sh`
5858

5959
---
6060

61+
## Test Configuration Scenarios
62+
63+
All scenarios require the [standard variables](#required-variables) (`CYPRESS_BASE_URL`, `CYPRESS_LOGIN_IDP`, `CYPRESS_LOGIN_USERS`, `CYPRESS_KUBECONFIG_PATH`).
64+
65+
### General Scenarios
66+
67+
| Scenario | Key Variables | Description |
68+
|----------|---------------|-------------|
69+
| **Released Version** | `CYPRESS_COO_UI_INSTALL=true` | Install operators from redhat-operators catalog. Production-like testing. |
70+
| **Pre-provisioned COO** | `CYPRESS_SKIP_COO_INSTALL=true`, optionally `CYPRESS_COO_NAMESPACE=<ns>` | COO already installed. Tests still enable the monitoring plugin. Specify namespace if non-default. |
71+
| **Pre-provisioned Virtualization** | `CYPRESS_SKIP_KBV_INSTALL=true` | OpenShift Virtualization already installed. |
72+
| **Local Dev / PR Testing** | `CYPRESS_SKIP_ALL_INSTALL=true` | Run UI locally via `make start-feature-frontend` ([details](../../README.md#development)). Skips all setup. |
73+
| **Custom Images** | `CYPRESS_MP_IMAGE`, `CYPRESS_MCP_CONSOLE_IMAGE`, `CYPRESS_CHA_IMAGE`, `CYPRESS_CUSTOM_COO_BUNDLE_IMAGE` | Patch component images in the CSV, or replace the operator bundle. Combine with an installation method above. |
74+
| **FBC Image** | `CYPRESS_FBC_STAGE_COO_IMAGE` | Install COO from File-Based Catalog image. For release validation. |
75+
| **Konflux CI Bundle** | `CYPRESS_KONFLUX_COO_BUNDLE_IMAGE=<image>` | Install COO from Konflux CI bundle. For PR/CI testing. |
76+
77+
### Test Areas
78+
79+
| Area | Description | Run Command |
80+
|------|-------------|-------------|
81+
| **Monitoring (CMO)** | Core monitoring tests against CMO stack. No additional operator installation needed. | `npm run test-cypress-monitoring` |
82+
| **COO (Perses, Dashboards, Incidents)** | Requires COO installation. | `npm run test-cypress-coo` |
83+
| **Incidents** | COO subset. Set `CYPRESS_TIMEZONE` to match cluster timezone. | `npm run test-cypress-incidents` |
84+
| **Virtualization** | Requires OpenShift Virtualization (KubeVirt) installation. | `npm run test-cypress-virtualization` |
85+
86+
---
87+
6188
## Environment Variables Reference
6289

6390
### Required Variables
@@ -128,88 +155,6 @@ export CYPRESS_MOCK_NEW_METRICS=true
128155

129156
---
130157

131-
## Configuration Examples
132-
133-
### Example 1: Testing with Non-Admin User
134-
135-
```bash
136-
export CYPRESS_BASE_URL=https://console-openshift-console.apps.cluster.example.com
137-
export CYPRESS_LOGIN_IDP=flexy-htpasswd-provider
138-
export CYPRESS_LOGIN_USERS=testuser:testpassword
139-
export CYPRESS_KUBECONFIG_PATH=~/Downloads/kubeconfig
140-
```
141-
142-
### Example 2: Testing with Kubeadmin
143-
144-
```bash
145-
export CYPRESS_BASE_URL=https://console-openshift-console.apps.cluster.example.com
146-
export CYPRESS_LOGIN_IDP=kube:admin
147-
export CYPRESS_LOGIN_USERS=kubeadmin:admin-password
148-
export CYPRESS_KUBECONFIG_PATH=~/Downloads/kubeconfig
149-
```
150-
151-
### Example 3: Testing Custom Plugin Build
152-
153-
```bash
154-
# Required variables
155-
export CYPRESS_BASE_URL=https://...
156-
export CYPRESS_LOGIN_IDP=flexy-htpasswd-provider
157-
export CYPRESS_LOGIN_USERS=username:password
158-
export CYPRESS_KUBECONFIG_PATH=~/Downloads/kubeconfig
159-
160-
# Custom image
161-
export CYPRESS_MP_IMAGE=quay.io/myorg/monitoring-plugin:my-branch
162-
export CYPRESS_MCP_CONSOLE_IMAGE=quay.io/myorg/monitoring-console-plugin:my-branch
163-
```
164-
165-
### Example 4: Testing Custom cluster-health-analyzer Build
166-
167-
For CI jobs testing PRs to cluster-health-analyzer:
168-
169-
```bash
170-
# Required variables
171-
export CYPRESS_BASE_URL=https://...
172-
export CYPRESS_LOGIN_IDP=flexy-htpasswd-provider
173-
export CYPRESS_LOGIN_USERS=username:password
174-
export CYPRESS_KUBECONFIG_PATH=~/Downloads/kubeconfig
175-
176-
# Custom cluster-health-analyzer image built from PR
177-
export CYPRESS_CHA_IMAGE=quay.io/myorg/cluster-health-analyzer:pr-123
178-
179-
# Use COO bundle (required for incidents feature testing)
180-
export CYPRESS_KONFLUX_COO_BUNDLE_IMAGE=quay.io/rhobs/observability-operator-bundle:latest
181-
```
182-
183-
### Example 5: Pre-Provisioned Cluster (Skip Installations)
184-
185-
```bash
186-
# Required variables
187-
export CYPRESS_BASE_URL=https://...
188-
export CYPRESS_LOGIN_IDP=flexy-htpasswd-provider
189-
export CYPRESS_LOGIN_USERS=username:password
190-
export CYPRESS_KUBECONFIG_PATH=~/Downloads/kubeconfig
191-
192-
# Skip installations (cluster already configured)
193-
export CYPRESS_SKIP_ALL_INSTALL=true
194-
```
195-
196-
### Example 6: Configurable COO Namespace
197-
198-
Set the following var to specify the Cluster Observability Operator namespace. Defaults to `openshift-cluster-observability-operator` if not set. This is useful when testing with different namespace configurations (e.g., using `coo` instead of the default).
199-
```bash
200-
export CYPRESS_COO_NAMESPACE=openshift-cluster-observability-operator
201-
```
202-
203-
### Example 7: Debug Mode
204-
205-
```bash
206-
# Required variables + debug
207-
export CYPRESS_DEBUG=true
208-
export CYPRESS_SESSION=true # Faster test execution
209-
```
210-
211-
---
212-
213158
## Running Cypress
214159

215160
### Interactive Mode (GUI)
@@ -448,9 +393,20 @@ cypress/
448393

449394
---
450395

451-
### Incident Detection Test Documentation
396+
## Incident Detection Test Documentation
397+
398+
For configuration scenarios, see [COO Tests](#test-configuration-scenarios) above.
399+
400+
### Incidents-Specific Variables
401+
402+
| Variable | Default | Description |
403+
|----------|---------|-------------|
404+
| `CYPRESS_TIMEZONE` | `UTC` | Cluster timezone for incident timeline calculations |
405+
| `CYPRESS_MOCK_NEW_METRICS` | `false` | Transform old metric names to new format in mocks |
406+
407+
### Test Case Documentation
452408

453-
Test documentation for the Incidents feature is available at [`docs/incident_detection/tests/`](../../docs/incident_detection/tests/) in the repository root.
409+
Detailed test documentation: [`docs/incident_detection/tests/`](../../docs/incident_detection/tests/)
454410

455411
---
456412

0 commit comments

Comments
 (0)