Repository navigation
ci: run the test suite inside real Pyodide, as an advisory job - #976
Closed
ddivyanshsharmaa wants to merge 2 commits into
Closed
ddivyanshsharmaa wants to merge 2 commits into
ddivyanshsharmaa wants to merge 2 commits into
Conversation
run_pytest.mjs installs the pure-Python wheel through the notebook bootstrap, as check_pyodide_install.mjs does, and runs the non-slow suite in Pyodide under Node. Tests that need what a browser cannot provide (subprocesses, git for robot_descriptions, the teach panel, bdsim, window-mode rendering) are skipped there with a reason, in one place in tests/conftest.py; nothing changes on desktop. Four real findings from petercorke#633 are marked xfail under Pyodide, so the job is green while they stay visible: the movie getframe canvas, int32 path hashes, a negative dt in inline mode, and the browser ignoring the default backend. The job is advisory, like mypy, until it has a record of green runs. Refs petercorke#633 Co-Authored-By: Claude Code (Claude Opus 5.5) <noreply@anthropic.com>
Co-Authored-By: Claude Code (Claude Opus 5.5) <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 5 critical 6 high |
🟢 Metrics 20 complexity · 0 duplication
Metric Results Complexity 20 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This follows up my comment on #633. It adds an advisory
test-pyodidejob that runs the non-slow test suite inside real Pyodide under Node, on every PR, in parallel with the other jobs.docs/lite/wasm_check/run_pytest.mjsinstalls the pure-Python wheel through the real notebook bootstrap, the same waycheck_pyodide_install.mjsdoes. It copiestests/(and the files some tests read) into Pyodide's filesystem and runs pytest. pytest-timeout is disabled because Pyodide has nosignal.setitimer, and capture issysbecause Pyodide has no file-descriptor capture.tests/conftest.pykeeps every browser-only rule in one place, and the rules are active only whensys.platform == "emscripten". Desktop runs collect and run exactly the same tests as before.robot_descriptions; the teach panel refusing to run under Jupyter; bdsim not installed by the bootstrap; and tests that expect window-mode rendering.getframecanvas, int32 path hashes, negativedtinline, and the default backend being ignored). They stay visible and will show as XPASS when each is fixed. This PR does not fix them.docs.yml, because the notebook-bootstrap tests callasyncio.run()inside Pyodide. That needs WebAssembly stack switching (JSPI), which Node 22 lacks.mypy: it hascontinue-on-errorand is not inAll tests passed. It can be made required once it has a record of green runs.docs/lite/wasm_check/README.mdsays how to run the job locally and how to skip a browser-only test.There are no changes to the toolbox code and no change in numerical results or public behaviour.
Related issue
Refs #633. It covers the "real Pyodide" half. The pure-Python desktop half is already done by #946.
What I ran
ubuntu-latestwith Pyodide 314.0.6 and Node 26.13.1: 2159 passed, 347 skipped, 9 xfailed, 1 xpassed, 0 failed, in 2 min 49 s.test_book_paths_are_unchanged. The xpass is that test's parent, which completes because its failing sub-cases are already recorded.All tests passedstayed green with the newconftest.py.robot_descriptions/__version__ones that this machine has on unchangedmain.Codacy
Codacy's 11 findings are all in
run_pytest.mjs. Ten flagreadFileSync/readdirSyncwith a non-literal path (ESLintdetect-non-literal-fs-filenameand the matching Semgrep rule), and one flags the usage message passed toconsole.error. The paths are the repository's own files and the wheel built in the same job, andcheck_pyodide_install.mjsreads files the same way (lines 47–48). Following CONTRIBUTING, I have left the code as it is rather than rewriting it for the advisory check.AI disclosure
This change was written with Claude Code (Claude Opus 5.5) and OpenAI Codex. I read the diff and checked the CI runs myself.
🤖 Generated with Claude Code