Skip to content

Commit ec72a2b

Browse files
committed
Update docs and rules again
1 parent 22148e2 commit ec72a2b

File tree

5 files changed

+60
-8
lines changed

5 files changed

+60
-8
lines changed

.claude/memories/ci-e2e-testing.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test.beforeAll(async ({ }, testInfo) => {
6969
- Basic functionality verification
7070
- Health checks and core features
7171

72-
2. **Showcase Tests** (defined in `playwright.config.ts`)
72+
2. **Showcase Tests** (defined in `e2e-tests/playwright/projects.json`)
7373
- `showcase`: General functionality tests with base deployment using Helm chart
7474
- `showcase-rbac`: General functionality tests with RBAC-enabled deployment using Helm chart
7575
- `showcase-k8s`: Kubernetes integration tests with base deployment
@@ -81,6 +81,10 @@ test.beforeAll(async ({ }, testInfo) => {
8181
- `showcase-upgrade`: Upgrade scenario tests
8282
- `any-test`: Use for debugging when you need to run a specific tests
8383

84+
**Note**: All project names are defined in `e2e-tests/playwright/projects.json` as the single source of truth. This file is consumed by:
85+
- `playwright.config.ts` via TypeScript import (`e2e-tests/playwright/projects.ts`)
86+
- CI/CD scripts via `.ibm/pipelines/playwright-projects.sh` (exports as `$PW_PROJECT_*` variables)
87+
8488
3. **Authentication Provider Tests** (`showcase-auth-providers`)
8589
- OIDC (Red Hat Backstage Keycloak)
8690
- Microsoft OAuth2
@@ -301,6 +305,7 @@ For CI/CD pipeline execution, tests run in a containerized environment using the
301305
- **`.ibm/pipelines/utils.sh`**: Utility functions
302306
- **`.ibm/pipelines/reporting.sh`**: Reporting and notifications
303307
- **`.ibm/pipelines/env_variables.sh`**: Environment variable management
308+
- **`.ibm/pipelines/playwright-projects.sh`**: Loads Playwright project names from `projects.json` as `$PW_PROJECT_*` variables
304309

305310
#### CI Infrastructure Package Configuration
306311

@@ -441,6 +446,7 @@ brew install gnu-sed
441446
- [OpenShift CI Pipeline README](.ibm/pipelines/README.md)
442447

443448
### Configuration Files
449+
- [Playwright Project Names (Single Source of Truth)](e2e-tests/playwright/projects.json)
444450
- [Playwright Configuration](e2e-tests/playwright.config.ts)
445451
- [Package Configuration](e2e-tests/package.json)
446452
- [Dynamic Plugins Config](dynamic-plugins/package.json)

.cursor/rules/ci-e2e-testing.mdc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ test.beforeAll(async ({ }, testInfo) => {
7575
- Basic functionality verification
7676
- Health checks and core features
7777

78-
2. **Showcase Tests** (defined in `playwright.config.ts`)
78+
2. **Showcase Tests** (defined in `e2e-tests/playwright/projects.json`)
7979
- `showcase`: General functionality tests with base deployment using Helm chart
8080
- `showcase-rbac`: General functionality tests with RBAC-enabled deployment using Helm chart
8181
- `showcase-k8s`: Kubernetes integration tests with base deployment
@@ -87,6 +87,10 @@ test.beforeAll(async ({ }, testInfo) => {
8787
- `showcase-upgrade`: Upgrade scenario tests
8888
- `any-test`: Use for debugging when you need to run a specific tests
8989

90+
**Note**: All project names are defined in `e2e-tests/playwright/projects.json` as the single source of truth. This file is consumed by:
91+
- `playwright.config.ts` via TypeScript import (`e2e-tests/playwright/projects.ts`)
92+
- CI/CD scripts via `.ibm/pipelines/playwright-projects.sh` (exports as `$PW_PROJECT_*` variables)
93+
9094
3. **Authentication Provider Tests** (`showcase-auth-providers`)
9195
- OIDC (Red Hat Backstage Keycloak)
9296
- Microsoft OAuth2
@@ -307,6 +311,7 @@ For CI/CD pipeline execution, tests run in a containerized environment using the
307311
- **`.ibm/pipelines/utils.sh`**: Utility functions
308312
- **`.ibm/pipelines/reporting.sh`**: Reporting and notifications
309313
- **`.ibm/pipelines/env_variables.sh`**: Environment variable management
314+
- **`.ibm/pipelines/playwright-projects.sh`**: Loads Playwright project names from `projects.json` as `$PW_PROJECT_*` variables
310315

311316
#### CI Infrastructure Package Configuration
312317

@@ -447,6 +452,7 @@ brew install gnu-sed
447452
- [OpenShift CI Pipeline README](.ibm/pipelines/README.md)
448453

449454
### Configuration Files
455+
- [Playwright Project Names (Single Source of Truth)](e2e-tests/playwright/projects.json)
450456
- [Playwright Configuration](e2e-tests/playwright.config.ts)
451457
- [Package Configuration](e2e-tests/package.json)
452458
- [Dynamic Plugins Config](dynamic-plugins/package.json)

.rulesync/rules/ci-e2e-testing.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test.beforeAll(async ({ }, testInfo) => {
8686
- Basic functionality verification
8787
- Health checks and core features
8888

89-
2. **Showcase Tests** (defined in `playwright.config.ts`)
89+
2. **Showcase Tests** (defined in `e2e-tests/playwright/projects.json`)
9090
- `showcase`: General functionality tests with base deployment using Helm chart
9191
- `showcase-rbac`: General functionality tests with RBAC-enabled deployment using Helm chart
9292
- `showcase-k8s`: Kubernetes integration tests with base deployment
@@ -98,6 +98,10 @@ test.beforeAll(async ({ }, testInfo) => {
9898
- `showcase-upgrade`: Upgrade scenario tests
9999
- `any-test`: Use for debugging when you need to run a specific tests
100100

101+
**Note**: All project names are defined in `e2e-tests/playwright/projects.json` as the single source of truth. This file is consumed by:
102+
- `playwright.config.ts` via TypeScript import (`e2e-tests/playwright/projects.ts`)
103+
- CI/CD scripts via `.ibm/pipelines/playwright-projects.sh` (exports as `$PW_PROJECT_*` variables)
104+
101105
3. **Authentication Provider Tests** (`showcase-auth-providers`)
102106
- OIDC (Red Hat Backstage Keycloak)
103107
- Microsoft OAuth2
@@ -318,6 +322,7 @@ For CI/CD pipeline execution, tests run in a containerized environment using the
318322
- **`.ibm/pipelines/utils.sh`**: Utility functions
319323
- **`.ibm/pipelines/reporting.sh`**: Reporting and notifications
320324
- **`.ibm/pipelines/env_variables.sh`**: Environment variable management
325+
- **`.ibm/pipelines/playwright-projects.sh`**: Loads Playwright project names from `projects.json` as `$PW_PROJECT_*` variables
321326

322327
#### CI Infrastructure Package Configuration
323328

@@ -458,6 +463,7 @@ brew install gnu-sed
458463
- [OpenShift CI Pipeline README](.ibm/pipelines/README.md)
459464

460465
### Configuration Files
466+
- [Playwright Project Names (Single Source of Truth)](e2e-tests/playwright/projects.json)
461467
- [Playwright Configuration](e2e-tests/playwright.config.ts)
462468
- [Package Configuration](e2e-tests/package.json)
463469
- [Dynamic Plugins Config](dynamic-plugins/package.json)

docs/e2e-tests/CI.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,22 @@ The OpenShift CI definitions for PR checks and nightly runs, as well as executio
158158

159159
Detailed steps on how the tests and reports are managed can be found in the `run_tests()` function within the `utils.sh` script. The CI pipeline executes tests directly using Playwright's `--project` flag (e.g., `npx playwright test --project=showcase`) rather than yarn script aliases. The `check_and_test()` and `run_tests()` functions accept an explicit Playwright project argument, decoupling the namespace from the test project name for more flexible reuse.
160160

161+
### Playwright Project Names (Single Source of Truth)
162+
163+
All Playwright project names are defined in a single JSON file: [`e2e-tests/playwright/projects.json`](../../e2e-tests/playwright/projects.json). This file serves as the single source of truth for:
164+
165+
- **TypeScript** (`playwright.config.ts`): Imports via `e2e-tests/playwright/projects.ts`
166+
- **CI/CD Scripts**: Loaded via `.ibm/pipelines/playwright-projects.sh` as `$PW_PROJECT_*` environment variables
167+
168+
When adding or modifying Playwright projects, update `projects.json` first. The project names are automatically available as:
169+
170+
| JSON Key | Shell Variable | Value |
171+
|----------|----------------|-------|
172+
| `SHOWCASE` | `$PW_PROJECT_SHOWCASE` | `showcase` |
173+
| `SHOWCASE_RBAC` | `$PW_PROJECT_SHOWCASE_RBAC` | `showcase-rbac` |
174+
| `SHOWCASE_K8S` | `$PW_PROJECT_SHOWCASE_K8S` | `showcase-k8s` |
175+
| ... | ... | ... |
176+
161177
When the test run is complete, the status will be reported under your PR checks.
162178

163179
> **Important:** The environment in which the PR tests are executed is shared and ephemeral. All PR tests queue for the same environment, which is destroyed and recreated for each PR. Test outputs (screenshots, recordings, walkthroughs, etc.) are stored for a retention period of **6 months** and can be accessed by checking the **Details -> Artifacts** of the test check on the PR.

docs/e2e-tests/README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,33 @@ The Playwright command line supports many options; see them [here](https://playw
8989
npx playwright test e2e-tests/playwright/e2e/your-test-file.spec.ts
9090
```
9191

92-
Our project contains multiple test suites for different environments and configurations. Some useful scripts to run the tests:
92+
Our project contains multiple test suites for different environments and configurations. Run tests using the Playwright project names defined in [`projects.json`](../../e2e-tests/playwright/projects.json):
9393

9494
```bash
95-
yarn showcase # Runs the showcase test suite
96-
yarn showcase-rbac # Runs the showcase RBAC test suite
97-
yarn showcase-1-2-x # Runs the showcase 1.2.x test suite
98-
yarn showcase-rbac-1-2-x # Runs the showcase RBAC 1.2.x test suite
95+
# Source the project variables (from repo root)
96+
source .ibm/pipelines/playwright-projects.sh
97+
98+
# Run tests using the project variables
99+
npx playwright test --project="$PW_PROJECT_SHOWCASE" # General showcase tests
100+
npx playwright test --project="$PW_PROJECT_SHOWCASE_RBAC" # RBAC tests
101+
npx playwright test --project="$PW_PROJECT_SHOWCASE_K8S" # Kubernetes tests
102+
npx playwright test --project="$PW_PROJECT_SHOWCASE_OPERATOR" # Operator tests
103+
104+
# Or use the project names directly
105+
npx playwright test --project=showcase
106+
npx playwright test --project=showcase-rbac
99107
```
100108

109+
### Playwright Project Names
110+
111+
All Playwright project names are defined in [`e2e-tests/playwright/projects.json`](../../e2e-tests/playwright/projects.json). This is the single source of truth for project names used in:
112+
113+
- `playwright.config.ts` (via TypeScript import)
114+
- CI/CD pipeline scripts (via `$PW_PROJECT_*` environment variables)
115+
- yarn scripts in `package.json`
116+
117+
See the [CI documentation](CI.md#playwright-project-names-single-source-of-truth) for more details.
118+
101119
## Setting Up Backstage Configuration During the Pipeline
102120

103121
[app-config-rhdh.yaml](../../.ibm/pipelines/resources/config_map/app-config-rhdh.yaml) is the configuration file used to add plugins or any other kind of configuration into Backstage during pipeline execution.

0 commit comments

Comments
 (0)