Repository navigation
Conversation
table.selected_rows() -> table.selected(): render_itables's named accessor is .selected(); selected_rows is the widget trait. Caught by the website example smoke suite (the apps rendered nothing).
So the website example smoke suite can boot every example: chatlas, querychat, anthropic (ai-exploration guide), nibabel (niivue), mdtraj (nglview), mocpy (ipyaladin), scikit-learn (k3d/embedding-atlas), bokeh_sampledata (bokeh>=3.8 split), leafmap + rioxarray + mapclassify + localtileserver + scipy (leafmap page).
- Check view attachment via output children, not .lm-Widget (raw-DOM widgets like pythreejs don't carry that class); any output counts, not just the first - Overlay runs (reactable, vizarr) with an env-var skip lift, matching the existing REACTABLE_OVERLAY pattern; leafmap joins the shared group instead since the group's plotly is <7 anyway - Manifest entries: ipyevents.js 404s (leafmap), drawdata svg height console noise, ipydatagrid icon 404s, pydeck widget-less demos, gaia parquet not committed, vitessce draft page, localtileserver's in-process uvicorn suppressing the readiness probe, dead niivue.com/demos/images host
03_dark_mode needs reactable AND ipyleaflet, and the overlay breaks ipyleaflet's nbextension lookup, so no environment runs it; -k reactable already covers every example the overlay can serve.
…t types - The manifest guardrail previously only ran under py-check.yaml, whose path filters exclude website/** -- a website-only PR could add an unmanifested helper (or stale entry) unnoticed. Run it on shard 0. - load_manifest rejected unknown keys but not wrong value types: a scalar allowed_errors silently became a tuple of characters (trivially permissive), and a quoted no_widget string was truthy.
✅ Deploy Preview for shinywidgets canceled.
|
There was a problem hiding this comment.
🟡 Changes recommended
The smoke tests can pass despite Python render errors, transport failures, or incomplete widget initialization, leaving significant failures undetected.
3 open issues
What changed in this PR
Adds browser smoke tests for website examples, extending CI coverage to runnable documentation and fixing incorrect table-selection calls.
Changes:
- Adds example discovery, manifest overrides, and coverage guardrails.
- Runs smoke tests across six CI shards, with separate dependency overlays.
- Corrects
render_itablesaccessor usage in examples and guides.
| File | Description |
|---|---|
| website/widgets/obsplot/index.md | Corrects selection accessor documentation and snippet. |
| website/widgets/obsplot/gallery/showcase_gapminder_dashboard.py | Fixes table-selection accessor. |
| website/widgets/obsplot/examples/12_table_row_highlight.py | Fixes table-selection accessor. |
| website/widgets/lonboard/index.md | Corrects selection accessor documentation and snippet. |
| website/widgets/lonboard/examples/14_table_to_fly_to.py | Fixes table-driven map selection. |
| tests/unit/test_examples_manifest.py | Adds discovery and manifest guardrails. |
| tests/examples/test_smoke.py | Checks widget attachment and browser errors. |
| tests/examples/manifest.yml | Records skips and permitted errors. |
| tests/examples/examples-pytest.ini | Configures parallel execution and timeouts. |
| tests/examples/discovery.py | Discovers apps and loads overrides. |
| tests/examples/conftest.py | Parametrizes examples and manages app processes. |
| pytest.ini | Excludes browser examples from default recursion. |
| pyproject.toml | Adds example dependencies to the test group. |
| Makefile | Adds shared and overlay smoke-test targets. |
| AGENTS.md | Documents the example smoke suite. |
| .github/workflows/website-examples.yaml | Adds sharded CI and overlay runs. |
| .agents/skills/adding-shinywidgets-integrations/SKILL.md | Documents smoke-test requirements for examples. |
Review effort: Balanced
- Capture transport-level request failures (requestfailed), which produce no HTTP response and were invisible to collect_errors - Assert no .shiny-output-error elements: a Python render error shows there (not on the console), and a working sibling widget would let it pass. pydeck's intentional deprecation demo opts out via a new allow_output_error manifest key - no_widget examples waited for nothing, so pydeck's static-iframe demo could pass without rendering; a new wait_selector manifest key waits for the iframe itself - Brief settle after readiness so late async errors land before the assertions
The settle added in fe42641 surfaces errors that land just after view attach; three known classes appear only in CI's headless Linux Chromium: embedding-atlas's WebGPU warnings (filtered identically by the deep suite), lonboard's benign luma.gl re-init message, and anywidget <0.11.1's init failure under CPU contention (the deep suite xfails the same class).
- niivue.com/demos/images 404s for every file since niivue moved to the mono repo; some assets exist on the replacement GitHub Pages host but aal/BrainMesh/narps don't, so the niivue page needs a data-host migration beyond this PR. Skip all 9 affected examples. - aladin-lite's usage-logger endpoint and pygwalker's CORS-blocked update check are third-party phone-home noise on every init. - maplibre joins lonboard in tolerating the benign luma.gl re-init message under CI contention.
There was a problem hiding this comment.
🟡 Changes recommended
The changes re-enable a broken vizarr example and whitelist a lonboard initialization error, allowing smoke tests to pass despite lost Python-to-JavaScript updates.
2 open issues
3 resolved since last review
Review effort: Balanced
…ntion Addresses the second Copilot round: - The un-skip env var lifted every manifest skip, so the vizarr overlay re-enabled 01_quickstart, whose IDR dataset is dead upstream. Skips now come in two kinds: an overlay: <name> entry (lifted only by the matching SHINYWIDGETS_EXAMPLES_OVERLAY run) and a plain skip entry (never lifted). vizarr/01 stays skipped in every run; the vizarr overlay run shows 7 passed, 1 skipped. - Whitelisting lonboards anywidget init error would permanently mask real init failures. Mirror the deep suite instead: a version- conditioned, non-strict xfail on lonboard/keplergl examples while anywidget <0.11.1 (manzt/anywidget#1032), lifting itself at 0.11.1.
9dc193b to
ae116e7
Compare
- The single-level globs silently missed nested examples: the recursive glob finds 2 more apps (guide/performance/examples/lifetimes/08,09, both pass) and 1 more helper (manifested as not_app). Future nested examples can no longer escape the guardrail. - Add a job-level timeout-minutes alongside the step-level ones.
There was a problem hiding this comment.
🟡 Changes recommended
The filename-based check misses four lonboard-rendering apps, leaving the documented CPU-contention failure unhandled in CI on anywidget versions below 0.11.1.
1 open issue
1 resolved since last review
Review effort: Balanced
| if override.overlay != os.environ.get(_OVERLAY_ENV): | ||
| skip_reason = f"needs the {override.overlay} dependency overlay" | ||
| marks = [pytest.mark.skip(reason=skip_reason)] if skip_reason else [] | ||
| if any(pkg in example.rel for pkg in _BIG_ESM_PACKAGES): |
There was a problem hiding this comment.
Fixed in f4c65ad: applicability is now determined from source, not paths. uses_big_esm_package() in tests/examples/discovery.py scans each example for lonboard/keplergl imports or render_lonboard/render_keplergl usage (path match kept as a backstop), and a new guardrail in tests/unit/test_examples_manifest.py pins the exact set of detected examples outside lonboard/keplergl paths — the four you named — so future examples that render these packages under a different path fail the unit suite until the xfail logic covers them.


Why
The website ships ~600 runnable examples (
website/widgets/*/examples/,website/guide/*/examples/) that users copy code from, but nothing in CI verified they still boot and render. This PR adds a suite that boots every one of them in a headless browser on each PR and asserts a widget view attaches with no console errors, no failed requests, and no Shiny output errors.It pays for itself immediately — the first runs caught real bit-rot:
table.selected_rows()on arender_itablesobject — the accessor is.selected(), so both apps rendered nothing (fixed here, including the page prose that teaches the wrong call).niivue.com/demos/imageshost 404s upstream (niivue moved to the mono repo). All 9 niivue examples load volumes/meshes from it — some assets exist on the replacement host (niivue.github.io/niivue-demo-images, e.g.mni152.nii.gz,pcasl.nii.gz) butaal.*,BrainMesh.*, and the narps map don't, so the niivue page needs a data-host migration beyond this PR (affected examples are skipped with a pointer here).minio-dev.openmicroscopy.org .../6001240.zarr) — skipped; the example needs a new dataset.mapwidget,ipydeck,chatlas,nibabel,leafmap, … — added to thetestdependency group).How it works
tests/examples/discovers example apps at collection time (Express orApp(markers, recursive globs), one pytest param per app: boot withshiny_app_gen, wait for any.shiny-ipywidget-outputto gain a child element (a view attach —.lm-Widgetisn't universal; raw-DOM views like pythreejs don't carry it), then assert: no.shiny-output-errorelements (Python render errors don't hit the console), no console errors, no failed requests, no transport-level failures. 614 example files → 610 discovered apps; 586 tested in the shared run + overlays, 24 hard-skipped with reasons.tests/examples/manifest.ymlholds per-example overrides (not_app,skip,overlay,no_widget,wait_selector,allow_output_error,allowed_errors/allowed_404s). A guardrail unit test (tests/unit/test_examples_manifest.py, runs in both workflows) fails the build if an example file is neither tested nor explained — new examples can't silently escape.REACTABLE_OVERLAYpattern:overlay: reactable(18 examples) andoverlay: vizarr(7) are skipped in the shared run and run in matching overlay runs (SHINYWIDGETS_EXAMPLES_OVERLAY=<name>); plainskip:entries are never lifted. leafmap instead joins the shared group since itsplotly<7constraint matches what the group already resolves.ANYWIDGET_INIT_XFAILwhile anywidget < 0.11.1 (fix: remove ready gate on comm messages to prevent permanent desync manzt/anywidget#1032) — CI CPU contention otherwise intermittently fails widget init; the workaround lifts itself at 0.11.1.website-examples.yamlworkflow: 6 shards × 3 xdist workers (same shape aspy-playwright, 10-min step timeouts + job-level bound), overlays + guardrail on shard 0. It's a separate workflow so itspaths:filter can includewebsite/**without making website-only PRs run the 5-Python unit matrix and the deep Playwright suite. Shards currently finish in ~3-5 min, inside the existing CI envelope.Notable skips, each with a reason in the manifest: niivue (dead upstream host), vizarr/01 (dead dataset), localtileserver (its in-process tile-server uvicorn suppresses the readiness log line Shiny's probe waits for), the draft vitessce page, the deliberately uncommitted gaia-5m parquet, and
03_dark_mode(needs reactable and ipyleaflet; no single environment runs both).Pre-existing gaps this surfaced (not fixed here)
ipyeventsships its nbextension inside the package (notshare/jupyter/nbextensions), sorequire_dependencies()can't serve it locally: leafmap examples 404 on/ipyevents.jsbefore the CDN fallback kicks in (widget still renders). Tolerated viaallowed_404s; a local-serving fix belongs in a separate change./lib/anywidget-0.0/(dependency-resolution quirk, cosmetic).test_geolibre_local_cog_via_proxyflaked once on this branch (tile-response timeout under runner contention, passed on re-run and on main consistently) — pre-existing flake class, not caused by this change.