Figure out testing on wasm
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
We don't currently run the tests for `piet-web`, which is getting us into trouble. Getting tests working on wasm should be possible. There are a few different parts to this:
- [ ] piet-web tests: these should be run headless; I don't think this should be too tricky.
- [ ] snapshot tests: this will require some way of generating a bitmap from a web `RenderContext`. I'm sure this is possible, but it will require some investigation.
- [ ] piet-common tests: these will either need to be duplicated for wasm, or we'll have to use `#[cfg_attr(target_arc = "wasm32", wasm_bindgen]` or something on the tests themselves. This might be a good place to start, since there are only a handful of these tests, and they cover the most important stuff?
If anyone is interested in working on this they are welcome to; I might play around at least with the third item and see if I can get that working.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the piet-common tests, then investigate how piet-web tests can run headless on wasm. Review the snapshot tests and the web RenderContext path to determine how bitmap generation could work. Done means the piet-web, snapshot, and piet-common test groups run under wasm rather than remaining skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- testing-qa, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100