Add WebAssembly build, cockle and terminal deployments, and testing#52
Merged
ianthomas23 merged 4 commits intomainfrom Jan 9, 2026
Merged
Add WebAssembly build, cockle and terminal deployments, and testing#52ianthomas23 merged 4 commits intomainfrom
ianthomas23 merged 4 commits intomainfrom
Conversation
This was referenced Oct 23, 2025
75156c0 to
1a8393a
Compare
1a8393a to
ec1eeb4
Compare
Member
Author
|
I've rewritten the makefiles using cmake, so now the process to try this out locally is cd wasm
micromamba create -f wasm-environment.yml
micromamba activate git2cpp-wasm
cmake .
make
make serveas described in I've kept the I am using an in-source build as that works, switching to a separate build tree ( |
JohanMabille
approved these changes
Jan 9, 2026
Member
Author
|
Thanks @JohanMabille. Let's merge and I can iterate on increasing the number of tests covered by the WebAssembly test code. |
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 adds the ability to create a WebAssembly build of the local
git2cppsource code, createcockleand JupyterLiteterminaldeployments to manually check they work, and test viapytest.Most of it is in a new
wasmdirectory to keep it isolated except for some monkey-patching in the top-leveltestdirectory becausepytestwants it this way. I've tried to keep themakefile-based workflow as simple as possible.wasm/README.mdis the most useful file to read.As an example of the local deployments, the following video shows them working after running:
cd wasm micromamba create -f wasm-environment.yml micromamba activate git2cpp-wasm make make servegit2cpp.mp4
Note the video shows the
git2cpppackage coming from a local directory rather than fromprefix.dev.The JupyterLite deployment only differs from the
cockleone in that it uses the JupyterLite shared filesystem, which can and has been the source of different behaviour so it is useful to have them both.For the local testing:
This is only testing
test_git.py, but I will add more in time. The important difference here is the use ofGIT2CPP_TEST_WASMenvironment variable which enables a different set of test fixtures to the normalpytestrun.The wasm build clones the recipe from
emscripten-forge/recipes, modifies it to read the source code from the local directory, and builds it. The two deployments and the deployment used in the tests all use the built package. The testing using thepytest-playwrightextension with monkey-patching in both python and typescript to send the commands to acockle Shellin the browser and return the results in a format compatible withsubprocess.run.Work to do after this in separate PRs:
workflow_dispatchso that any maintainer can manually run it on any branch as required.main.