Skip to content

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

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

ci: explorer Playwright e2e gate (#249 PR 1)#9
rdhyee wants to merge 4 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/explorer-e2e.yml New CI workflow — active, green on this PR (see Verification)
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 — resolved

The cloud-sandbox PAT couldn't write under .github/workflows/ (no Workflows permission), so the workflow initially shipped in .github/workflows-pending/. It has since been moved into place and pushed with workflow-scoped credentials (commit 94fb5a3), and the gate ran on this PR:

✅ Green CI run: https://github.com/rdhyee/isamplesorg.github.io/actions/runs/274529143754 passed (17.4s), job total 1m12s (cold caches; Quarto/npm/browser caches warm from here).

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)

  • GitHub Actions run on this PR: 27452914375 — 4 passed (17.4s).
  • 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 and others added 4 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
Pushed from laptop with workflow-scoped credentials; the cloud sandbox
PAT couldn't write under .github/workflows/ (no Workflows permission),
so PR 1 shipped the file in .github/workflows-pending/ with this exact
move documented as the activation step. Activation-note header removed.

https://claude.ai/code/session_01R4oXhmYe3qJiGBbHwGG7zn

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 (MAJOR): spec_filter was expanded unquoted, letting a dispatch input
  smuggle Playwright flags (--pass-with-no-tests = fail-open green run),
  and the documented empty-filter-runs-all never worked because the ||
  fallback swallowed it. PR/push runs are now hardcoded to the smoke
  set; dispatch passes the filter as one quoted argument; empty filter
  runs all specs.
2 (MAJOR): pageErrors was asserted only in the first serial test, so an
  async OJS/runtime error during the later shared-page tests passed
  silently. afterEach now drains and asserts the accumulator after
  every test.
3 (NIT): README claimed dropping the filter runs the other explorer
  specs — it runs ALL Playwright specs including the Cesium tutorial
  suite; wording fixed.

Verified locally post-fix: 4 passed (6.5s) against a fresh render.

https://claude.ai/code/session_01R4oXhmYe3qJiGBbHwGG7zn

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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