Add WebAssembly build, cockle and terminal deployments, and testing #52
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.