Skip to content

ci: explorer Playwright e2e gate (#249 PR 1)#9

Draft
rdhyee wants to merge 2 commits into
mainfrom
claude/explorer-e2e-249
Draft

ci: explorer Playwright e2e gate (#249 PR 1)#9
rdhyee wants to merge 2 commits into
mainfrom
claude/explorer-e2e-249

Conversation

@rdhyee

@rdhyee rdhyee commented Jun 12, 2026

Copy link
Copy Markdown
Owner

What this is

PR 1 of the isamplesorg#249 refactor window: a browser-level regression gate for the explorer that must exist before any refactor of explorer.qmd lands. Infrastructure only — zero behavior changes to explorer.qmd.

Issue context: isamplesorg#249 (analysis + 2026-06-05 refactor-window update).

Changes

File What
.github/workflows-pending/explorer-e2e.yml New CI workflow (see Activation required below)
tests/playwright/explorer-smoke.spec.js New 4-test smoke set the gate runs
tests/playwright/explorer-map-overlay.spec.js Verbatim port of upstream bde53e2 — the isamplesorg#266 spec fix that landed upstream (PR isamplesorg#269 follow-up) but was missing on fork main, leaving the suite red against a selector that no longer exists
tests/README.md How to run the suite locally + what the gate covers
REFACTOR_PLAN_249.md Paste-ready draft comment for isamplesorg#249 with the staged refactor sequence

⚠️ Activation required (token-scope blocker)

The automation token (fine-grained PAT) lacks the Workflows permission, so it cannot create files under .github/workflows/ — push was rejected by GitHub, and the contents-API fallback returned 403 (both actually attempted). The workflow therefore ships in .github/workflows-pending/. To activate:

git mv .github/workflows-pending/explorer-e2e.yml .github/workflows/

No other edits needed — all internal paths already reference the final location. Because of this, there is no CI run link yet; all verification below is from local execution (fresh Ubuntu sandbox, same steps as the workflow).

What the gate does

On every PR touching the explorer (explorer.qmd, assets/**, workers/**, specs, config): installs pinned Quarto 1.6.42, renders only explorer.qmd (~10s — no Python deps / vocab generation needed, verified), serves docs/ with the repo's range-capable dev_server.py on :5860, runs explorer-smoke.spec.js in headless Chromium. Caches: Quarto .deb, ~/.npm (no lockfile in repo — it's gitignored — so npm ci/setup-node cache are unavailable), Playwright browsers keyed on resolved @playwright/test version. Failure uploads the Playwright report + traces as artifacts.

What's covered (one assertion each)

  1. Explorer loads — no uncaught pageerror AND no Error evaluating OJS cell console errors during boot (OJS swallows cell exceptions as console errors, so pageerror alone misses a dead explorer — same lesson as tests/test_smoke.py).
  2. Map canvas appears.cesium-viewer .cesium-widget canvas attached with non-zero bounding box.
  3. Facet sidebar renders — ≥4 static source-legend rows visible.
  4. Search box present — exactly one #sampleSearch (post-Duplicate search bars in Explorer isamplesorg/isamplesorg.github.io#266 contract).

All four share one page load (serial mode) per the documented "never hammer DuckDB-WASM with reloads" lesson.

What's NOT covered (by design)

  • No data correctness. The explorer streams multi-hundred-MB parquet from data.isamples.org; the gate never waits on facet counts, sample dots, or search results, so a slow/flaky data load cannot fail it. Deep data-dependent specs (facet-viewport, url-roundtrip, heatmap-overlay, search-real-count, …) remain on-demand: locally per tests/README.md, or in CI via the workflow's spec_filter dispatch input.
  • Not a deploy gate. The existing pre-deploy DuckDB-liveness smoke in quarto-pages.yml (tests/test_smoke.py) still guards production; this gate guards PRs.

Verification (executed runs)

  • Clean end-to-end CI simulation in the sandbox (fresh quarto render explorer.qmddev_server.py → suite): 4 passed (7.9s), twice (initial + clean re-run).
  • Ported Duplicate search bars in Explorer isamplesorg/isamplesorg.github.io#266 spec: npx playwright test explorer-map-overlay -g "sidebar search input is gone"1 passed (13.8s) (with ignoreHTTPSErrors for the sandbox's TLS-intercepting proxy; the smoke spec sets it on its own context — no-op on a clean network).
  • Workflow YAML parsed valid.
  • Sandbox quirk worth knowing: the sandbox proxy MITMs HTTPS, which is why the smoke spec's context sets ignoreHTTPSErrors: true and why headless WebGL (SwiftShader) was explicitly verified — Cesium draws an 864×400 canvas headlessly.

Next (per REFACTOR_PLAN_249.md — paste into isamplesorg#249 after light edit)

PR 2 characterization tests around upcoming seams (isamplesorg#260/isamplesorg#265/isamplesorg#267/isamplesorg#239) → PR 3 pure-logic extraction to assets/js/ → PR 4 URL/state codecs + single-writer (isamplesorg#208) → PR 5 zoomWatcher controller splits (isamplesorg#189 only if its YAGNI trigger fires). Each stage gated on this suite staying green.


https://claude.ai/code/session_01R4oXhmYe3qJiGBbHwGG7zn

claude added 2 commits June 12, 2026 15:17
…ale on fork main)

Upstream commit bde53e2 (PR isamplesorg#269 follow-up) updated this spec when the
duplicate sidebar search box was removed; fork main got the explorer.qmd
change but not the spec alignment, leaving the suite red on a selector
that no longer exists. Verbatim port of the upstream hunk.

https://claude.ai/code/session_01R4oXhmYe3qJiGBbHwGG7zn
Browser-level regression gate that must exist before any refactor of
explorer.qmd: renders explorer.qmd (single-page, ~10s), serves docs/
with the repo's range-capable dev_server.py, and runs the new
explorer-smoke.spec.js in headless Chromium on every PR touching the
explorer.

The smoke set asserts structural liveness only (boot without
uncaught/OJS-cell errors, Cesium canvas at non-zero size, facet sidebar
rows, single search box) and deliberately never waits on parquet loads
from data.isamples.org, so slow data cannot flake the gate. Deeper
data-dependent specs stay runnable via workflow_dispatch spec_filter
and locally per tests/README.md.

NOTE: the workflow ships in .github/workflows-pending/ because the
automation token lacks the Workflows permission to write into
.github/workflows/. Activate with:
  git mv .github/workflows-pending/explorer-e2e.yml .github/workflows/

Caching: Quarto .deb (pinned 1.6.42), ~/.npm (package-lock.json is
gitignored, so npm ci/setup-node cache are unavailable), and Playwright
browsers keyed on the resolved @playwright/test version.

REFACTOR_PLAN_249.md is the paste-ready draft comment for issue isamplesorg#249
laying out the staged refactor-window sequence (PR 1 = this gate, then
characterization tests, pure-logic extraction, URL/state codecs per
isamplesorg#208, zoomWatcher controller splits per isamplesorg#189-when-triggered), each
stage gated on this suite staying green.

https://claude.ai/code/session_01R4oXhmYe3qJiGBbHwGG7zn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants