Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ profile dialects in `analyzer/profile_counter_registry.py`.
- `bench/bench.py <profile>` — time `analyze` on CPython.
- `bench/harness.mjs <scratch-dir> <profile...>` — 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

Expand Down
5 changes: 4 additions & 1 deletion web/bench/check_page.py
Original file line number Diff line number Diff line change
@@ -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": []}
Expand Down