Skip to content

Commit 86dc71e

Browse files
committed
ci(labs): run WASM persistence regression test in wasm-smoke-test job
Wires labs/tests/test_wasm_persistence.py into CI per @Shashank-Tripathi-07's request, so #1985's silent IndexedDB data-loss bug (and the Python name-mangling bug that caused it) can't regress unnoticed. PLAYWRIGHT_BROWSERS_PATH is pinned to a fixed, HOME-independent location on both the install and test steps, since labs/tests/conftest.py redirects $HOME for test isolation, which would otherwise make Playwright look for its browser cache in the wrong place once pytest runs. Kept --override-ini="addopts=" on the pytest invocation: the root pyproject.toml's addopts requires --cov=book/tools, but pytest-cov isn't installed in this job, which is the exact failure I hit locally before adding this override.
1 parent 9c5b2a3 commit 86dc71e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/labs-validate-dev.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: '🔮 Labs · ✅ Validate (Dev)'
23

34
# =============================================================================
@@ -279,14 +280,41 @@ jobs:
279280
# enabled and Pyodide threading works. A lab is considered healthy when
280281
# a marimo DOM signal (tab, cell, or island) attaches within 180s.
281282
- name: 🎭 Install Playwright + Chromium
283+
env:
284+
# Fixed, HOME-independent location. labs/tests/conftest.py
285+
# redirects $HOME for test isolation (so lab tests don't touch a
286+
# real ~/.mlsys), which would otherwise make Playwright look for
287+
# its browser cache in the wrong place once pytest runs. See the
288+
# WASM persistence regression test step below.
289+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.pw-browsers
282290
run: |
283291
pip install playwright
284292
python3 -m playwright install --with-deps chromium
285293
286294
- name: 🌐 Browser smoke test (real Chromium + Pyodide)
295+
env:
296+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.pw-browsers
287297
run: |
288298
python3 labs/tests/browser_smoke.py --labs-dir /tmp/wasm-smoke
289299
300+
# =====================================================================
301+
# WASM/IndexedDB persistence regression test (#1985 / PR #1988)
302+
# =====================================================================
303+
# DesignLedger.save_async() previously reported success while
304+
# silently failing to persist to IndexedDB, due to a Python
305+
# name-mangling bug (globalThis.__mlsys_temp_state written inside the
306+
# class body was rewritten to globalThis._DesignLedger__mlsys_temp_state,
307+
# desyncing it from the plain name the embedded JS read). Mocked unit
308+
# tests (mlsysim/tests/test_state.py) can't catch this class of bug
309+
# since they replace save_async() entirely. This runs the real
310+
# save_async() against real Pyodide + real IndexedDB in headless
311+
# Chromium and reads the write back through a separate connection.
312+
- name: 🧪 WASM persistence regression test (real IndexedDB)
313+
env:
314+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.pw-browsers
315+
run: |
316+
python3 -m pytest labs/tests/test_wasm_persistence.py -v --override-ini="addopts="
317+
290318
# ===========================================================================
291319
# Stage 4: Link integrity (Tier 2 — non-blocking baseline)
292320
# ===========================================================================

0 commit comments

Comments
 (0)