[PR #1374] [MERGED] feat(labs/ci): browser-level wasm smoke via playwright + coep/coop #9053

Closed
opened 2026-05-03 01:16:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1374
Author: @profvjreddi
Created: 4/17/2026
Status: Merged
Merged: 4/17/2026
Merged by: @profvjreddi

Base: devHead: feat/labs-browser-ci


📝 Commits (3)

  • 74948a4 feat(labs/ci): browser-level wasm smoke via playwright + coep/coop
  • a0292c6 fix(labs/ci): wait for pyodide boot, not just marimo shell
  • 4a5964b fix(labs/ci): detect marimo python cell exceptions via console log scan

📊 Changes

2 files changed (+272 additions, -3 deletions)

View changed files

📝 .github/workflows/labs-validate-dev.yml (+24 -3)
labs/tests/browser_smoke.py (+248 -0)

📄 Description

what

adds a real headless chromium check to the wasm-smoke-test job in .github/workflows/labs-validate-dev.yml. after exporting labs to wasm html, the job now also:

  1. installs playwright + chromium
  2. launches labs/tests/browser_smoke.py, which serves the exports with cross-origin isolation headers (coep require-corp, coop same-origin, corp cross-origin) and drives headless chromium to each lab
  3. waits up to 180s per lab for a marimo dom signal (marimo-island, [role=\"tab\"], or .marimo-cell) and captures any pageerror or console.error
  4. fails ci on timeout or uncaught error

why

lab_05_dist_train shipped broken in #1353: plotly was imported before micropip.install() in the wasm runtime. every static check, engine check, and node-pyodide wheel check passed. only a real browser with shared-array-buffer + coep/coop could surface the failure.

this pr makes that specific regression class impossible to ship silently. the smoke set includes labs/vol2/lab_05_dist_train.py as an explicit regression guard.

labs covered

  • vol1/lab_00_introduction.py — simple baseline
  • vol1/lab_01_ml_intro.py — existing coverage
  • vol2/lab_01_introduction.py — existing coverage
  • vol2/lab_05_dist_train.py — regression guard (the #1353 lab)

why coep/coop

pyodide's shared-array-buffer path (used by threading and some wheels) only enables when the document is cross-origin-isolated. a prior local playwright attempt timed out at 60s without these headers. matching the dev-preview site's headers + a 180s budget lines the ci up with actual prod boot time for labs that micropip-install mlsysim + plotly + pint.

test plan

  • ci green on this pr
  • all 4 labs boot + render a marimo dom signal in chromium
  • intentionally break a lab (e.g. reintroduce the #1353 import-order bug) locally to confirm the check fails loudly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1374 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `feat/labs-browser-ci` --- ### 📝 Commits (3) - [`74948a4`](https://github.com/harvard-edge/cs249r_book/commit/74948a498b61cbba8dc792ba9d587b37e71f8cf9) feat(labs/ci): browser-level wasm smoke via playwright + coep/coop - [`a0292c6`](https://github.com/harvard-edge/cs249r_book/commit/a0292c65a14fd7bc94f852f3e81d364d5de28cba) fix(labs/ci): wait for pyodide boot, not just marimo shell - [`4a5964b`](https://github.com/harvard-edge/cs249r_book/commit/4a5964ba18e372322ca7b6faba289beb888417fb) fix(labs/ci): detect marimo python cell exceptions via console log scan ### 📊 Changes **2 files changed** (+272 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/labs-validate-dev.yml` (+24 -3) ➕ `labs/tests/browser_smoke.py` (+248 -0) </details> ### 📄 Description ## what adds a real headless chromium check to the `wasm-smoke-test` job in `.github/workflows/labs-validate-dev.yml`. after exporting labs to wasm html, the job now also: 1. installs playwright + chromium 2. launches `labs/tests/browser_smoke.py`, which serves the exports with cross-origin isolation headers (coep `require-corp`, coop `same-origin`, corp `cross-origin`) and drives headless chromium to each lab 3. waits up to 180s per lab for a marimo dom signal (`marimo-island`, `[role=\"tab\"]`, or `.marimo-cell`) and captures any `pageerror` or `console.error` 4. fails ci on timeout or uncaught error ## why lab_05_dist_train shipped broken in #1353: plotly was imported before `micropip.install()` in the wasm runtime. every static check, engine check, and node-pyodide wheel check passed. only a real browser with shared-array-buffer + coep/coop could surface the failure. this pr makes that specific regression class impossible to ship silently. the smoke set includes `labs/vol2/lab_05_dist_train.py` as an explicit regression guard. ## labs covered - `vol1/lab_00_introduction.py` — simple baseline - `vol1/lab_01_ml_intro.py` — existing coverage - `vol2/lab_01_introduction.py` — existing coverage - `vol2/lab_05_dist_train.py` — regression guard (the #1353 lab) ## why coep/coop pyodide's shared-array-buffer path (used by threading and some wheels) only enables when the document is cross-origin-isolated. a prior local playwright attempt timed out at 60s without these headers. matching the dev-preview site's headers + a 180s budget lines the ci up with actual prod boot time for labs that micropip-install mlsysim + plotly + pint. ## test plan - [ ] ci green on this pr - [ ] all 4 labs boot + render a marimo dom signal in chromium - [ ] intentionally break a lab (e.g. reintroduce the #1353 import-order bug) locally to confirm the check fails loudly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:16:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#9053