You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -83,6 +83,7 @@ Deploy RHDH to the cluster. This:
83
83
| Parameter | Type | Default | Description |
84
84
|-----------|------|---------|-------------|
85
85
|`options.timeout`|`number \| null`|`600_000`| Playwright test timeout (ms) for the deployment. Pass a custom number to override, `0` for no timeout, or `null` to skip and let the consumer control the timeout. |
86
+
|`options.force`|`boolean`|`false`| Force redeployment even if already deployed. Bypasses the built-in `runOnce` protection. Useful for complex test scenarios where multiple `describe` sections need different RHDH configurations. |
Shared RHDH deployment across all tests in a worker. `deploy()` automatically skips if the deployment already succeeded, even after worker restarts.
19
+
Shared RHDH deployment across all tests in a worker. `deploy()` automatically skips if the deployment already succeeded, even after worker restarts. Use `deploy({ force: true })` to bypass this protection when you need to redeploy with different configurations in the same test file.
Copy file name to clipboardExpand all lines: docs/changelog.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,13 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
## [1.1.31] - Current
5
+
## [1.1.32] - Current
6
+
7
+
### Added
8
+
9
+
-**Force redeploy option for `rhdh.deploy()`**: Added optional `force` parameter to `rhdh.deploy({ force: true })` to bypass the built-in `runOnce` protection and force a fresh deployment. This enables complex test scenarios where multiple `describe` sections need different RHDH configurations (different app configs or dynamic plugin sets) within the same test file. Test writers can now call `rhdh.configure()` with new settings and `rhdh.deploy({ force: true })` to redeploy with the desired configuration.
Playwright's `beforeAll` runs once **per worker**, not once per test run. When a test fails, Playwright kills the worker and creates a new one for remaining tests — causing `beforeAll` to run again. Without protection, this would re-deploy RHDH from scratch every time a test fails.
172
172
:::
173
173
174
+
### Bypassing Protection with `force`
175
+
176
+
For complex test scenarios where multiple `describe` sections need different RHDH configurations (different app configs or dynamic plugin sets), you can use the `force` option to bypass the built-in protection:
awaitrhdh.deploy({ force: true }); // Force redeploy with new config
198
+
});
199
+
200
+
test("test with plugin set B", async ({ page }) => {
201
+
// Tests using plugin set B
202
+
});
203
+
});
204
+
```
205
+
174
206
## `test.runOnce` — Run Any Expensive Operation Once
175
207
176
208
While `rhdh.deploy()` has built-in protection, you may have **other expensive operations** in your `beforeAll` that also shouldn't repeat on worker restart — deploying external services, seeding databases, running setup scripts, etc.
Copy file name to clipboardExpand all lines: docs/guide/deployment/rhdh-deployment.md
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,12 @@ Deploy RHDH to the cluster:
93
93
awaitdeployment.deploy();
94
94
```
95
95
96
-
The `deploy()` method accepts an optional `{ timeout }` parameter to control the Playwright test timeout during deployment. By default, it sets the timeout to 600 seconds (10 minutes).
96
+
The `deploy()` method accepts optional parameters:
97
+
98
+
| Option | Type | Default | Description |
99
+
|--------|------|---------|-------------|
100
+
|`timeout`|`number \| null`|`600_000`| Playwright test timeout (ms) during deployment |
101
+
|`force`|`boolean`|`false`| Force redeployment even if already deployed |
`deploy()` automatically skips if the deployment already succeeded in the current test run (e.g., after a worker restart due to test failure). This prevents expensive re-deployments.
114
119
120
+
#### Force Redeploy
121
+
122
+
Use the `force` option to bypass the built-in `runOnce` protection and force a fresh deployment. This is useful for complex test scenarios where multiple `describe` sections need different RHDH configurations (different app configs or dynamic plugin sets) within the same test file:
0 commit comments