Run all tests in wasm except for credentials tests by ianthomas23 · Pull Request #123 · QuantStack/git2cpp · GitHub
Skip to content

Run all tests in wasm except for credentials tests#123

Merged
JohanMabille merged 1 commit into
mainfrom
wasm-tests
Mar 17, 2026
Merged

Run all tests in wasm except for credentials tests#123
JohanMabille merged 1 commit into
mainfrom
wasm-tests

Conversation

@ianthomas23

@ianthomas23 ianthomas23 commented Mar 17, 2026

Copy link
Copy Markdown
Member

This PR ensures that all tests are run in WebAssembly except for the credentials tests, support for which will follow in another PR.

Summary of changes:

  1. Add the 4 test files not already covered (diff, fetch, push and tag).
  2. Add monkeypatched functions os.rename, os.symlink and Path.write_bytes.
  3. Rearrange the monkeypatched functions to satisfy linter.
  4. New test function strip_ansi_colours which removes ANSI colour sequences from a string. This is needed because by default the normal linux/macos tests do not include colour sequences but the wasm ones do, so tests that check the contents of stdout returned by git2cpp functions need to remove colour sequences that are added. In future I am intending that we have some tests with and some without colour sequences for both the normal and wasm tests.
  5. Remove passing env in subprocess.run as the commit_env_config fixture does this automatically.

@codecov

codecov Bot commented Mar 17, 2026

Copy link
Copy Markdown

@ianthomas23

Copy link
Copy Markdown
Member Author

@JohanMabille JohanMabille merged commit c8109c6 into main Mar 17, 2026
8 checks passed
@JohanMabille JohanMabille deleted the wasm-tests branch March 17, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants