From 2141f9a88668e2d8270b0d2ba7642138eff484fa Mon Sep 17 00:00:00 2001 From: Aleksandr Efimov Date: Tue, 11 Aug 2026 14:41:18 +0300 Subject: [PATCH] Let the page check target a deployed URL --- web/README.md | 7 ++++--- web/bench/check_page.py | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/README.md b/web/README.md index 0ccc838..9756409 100644 --- a/web/README.md +++ b/web/README.md @@ -95,9 +95,10 @@ profile dialects in `analyzer/profile_counter_registry.py`. - `bench/bench.py ` — time `analyze` on CPython. - `bench/harness.mjs ` — the same timing under Pyodide in Node. Needs `npm install pyodide` in its working directory. -- `bench/check_page.py [out.png]` — drive the served page in Chromium, assert no - external requests, screenshot the result. Needs `pip install playwright` and - `playwright install chromium`. +- `bench/check_page.py [out.png]` — drive the served page in Chromium and fail + if it reaches an external host, raises a JS error, or renders nothing. Set + `QUERY_DOCTOR_PAGE_URL` to check the deployed site instead of a local build. + Needs `pip install playwright` and `playwright install chromium`. ## Open decisions diff --git a/web/bench/check_page.py b/web/bench/check_page.py index b9c7df3..313e636 100644 --- a/web/bench/check_page.py +++ b/web/bench/check_page.py @@ -1,11 +1,14 @@ """Drive the prototype page in a real browser: measure load, run the sample, screenshot.""" from __future__ import annotations +import os import sys from playwright.sync_api import sync_playwright -URL = "http://127.0.0.1:8799/" +# Defaults to the locally served build; point QUERY_DOCTOR_PAGE_URL at the +# deployed site to run the same checks against it. +URL = os.environ.get("QUERY_DOCTOR_PAGE_URL", "http://127.0.0.1:8799/") OUT = sys.argv[1] if len(sys.argv) > 1 else "page.png" transferred = {"requests": 0, "external": []}