Support running all tests in WebAssembly#89
Merged
JohanMabille merged 2 commits intomainfrom Feb 6, 2026
Merged
Conversation
Member
Author
|
Cannot test the new workflow until this PR is merged to |
JohanMabille
approved these changes
Feb 6, 2026
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.
This PR supports running all existing tests in WebAssembly. I am keeping the use of an "allow list" of test files to run in
conftest_wasm.pyso that new test files added are not automatically included as I don't fully trust the work flow yet.The tests run and pass locally for me (with some flakiness, see later). I have also added a CI run
test-wasmwhich will only run on demand rather than automatically.One change to existing tests is to change the code to read the contents of a file from the form
with open(file) as fto the formpathlib.Path.read_text()as the latter is easier to monkeypatch to run in the browser as it is a single atomic action rather than opening a stream to access file contents. It would be good to adopt this approach for future tests too, when they are added.There are two classes of problem observed:
git2cppcommands on error return the expected error text onstderrbut have an exit code of zero, which is incorrect. This must be due to some WebAssembly build problem, and is important to fix soon. These specific checks are currently skipped in the WebAssembly tests.libgit2for remote access.Example local test run output: