|
18 | 18 | await run("npm", ["run", "generate:cloudflare-wordpress-runtime-corpus"]) |
19 | 19 | await run("npm", ["run", "provision:cloudflare-wordpress-runtime-corpus", "--", "--local", "--persist-to", stateDirectory]) |
20 | 20 | await startWorker() |
| 21 | + await assertFullBootProbe() |
21 | 22 | await assertConcurrentMutations() |
22 | 23 | const coldHome = await timedWordPressPage(origin, "cold explanatory homepage") |
23 | 24 | const warmHome = await timedWordPressPage(origin, "warm explanatory homepage") |
|
49 | 50 | await assertLinkedAssets(restartedAdmin, "admin after cold restart") |
50 | 51 | cookies.length = 0 |
51 | 52 | await login() |
52 | | - console.log("Cloudflare local runtime gate passed: explanatory homepage, complete block styles, revision page cache, login, dashboard, post editor, concurrent canonical mutations, authenticated REST post and media creation, direct R2 upload serving, frontend/admin/editor assets, and cold-restart content, media, and session persistence.") |
| 53 | + console.log("Cloudflare local runtime gate passed: canonical full-boot probe, explanatory homepage, complete block styles, revision page cache, login, dashboard, post editor, concurrent canonical mutations, authenticated REST post and media creation, direct R2 upload serving, frontend/admin/editor assets, and cold-restart content, media, and session persistence.") |
53 | 54 | } finally { |
54 | 55 | await stopWorker() |
55 | 56 | await rm(stateDirectory, { recursive: true, force: true }) |
@@ -207,6 +208,17 @@ async function assertHealthResponse() { |
207 | 208 | if (response.status !== 200 || body.schema !== "wp-codebox/cloudflare-runtime-health/v1" || body.marker !== "wp-codebox-cloudflare-runtime-health" || body.phpVersion !== "8.5.8" || typeof body.wordpressVersion !== "string" || body.execution?.status !== "ok") throw new Error(`Unexpected Cloudflare runtime health envelope: ${JSON.stringify(body)}`) |
208 | 209 | } |
209 | 210 |
|
| 211 | +async function assertFullBootProbe() { |
| 212 | + const startedAt = performance.now() |
| 213 | + const response = await request(`${origin}/?phase=full`) |
| 214 | + const payload = await response.json() |
| 215 | + if (!response.ok || payload.schema !== "wp-codebox/cloudflare-boot-probe/v1" || payload.phase !== "full" || payload.completed !== true |
| 216 | + || payload.evidence?.bootMode !== "canonical-mdi" || !payload.evidence?.wordpressVersion || !payload.evidence?.phpVersion) { |
| 217 | + throw new Error(`Canonical full-boot probe failed: status=${response.status} payload=${JSON.stringify(payload)}.`) |
| 218 | + } |
| 219 | + console.log(`Canonical full-boot probe timing: ${Math.round(performance.now() - startedAt)}ms.`) |
| 220 | +} |
| 221 | + |
210 | 222 | async function assertWordPressPage(target, label) { |
211 | 223 | const response = await request(target) |
212 | 224 | const body = await response.text() |
|
0 commit comments