Commit 377cc3c
Add WebGL browser tests to
Note: This PR currently branches off
#1021 as there is a lint error
on `main` and I wanted to ensure CI fully passed.
> [!TIP]
> This is ready to review and passes all tests in CI.
### Context
This follows #1011 and is the
testing portion. In order to ensure renderer parity and correctness,
I've forked the `vello_hybrid` tests to also include a `_hybrid_webgl`
variant that use: `#[wasm_bindgen_test::wasm_bindgen_test]` and run via
the browser.
<details>
<summary>
As a demo of this PR, I locally introduced a "fake error" that reflects
the image. After running `wasm-pack test --chrome --features webgl` from
the `vello_sparse_tests` directory, I got the following very long
webpage. (unfurl details section by clicking this text, and scroll to
bottom of test results)
</summary>

</details>
### Features
- Add headless and headed browser testing of the webgl backend.
- Because the browser can't read from the file system easily, reference
images are inlined into the binary via the proc macro and provided to
the `check_refs` function.
- Existing `_hybrid` tests are unchanged. I've added a `_hybrid_webgl`
test.
- For ease of debugging the diff'd images are appended to the document
after tests have run. This makes it much easier to understand the
failure.
- Add `check vello_hybrid webgl backend passes vello_sparse_tests suite`
CI step that uses headless browser.
These tests could be fancier, but they do the job right now. Debugging a
failure isn't easy, however the diff can be manually retrieved and
compared by a human by spinning up a browser.
The goal of having webgl tests automatically match the vello_hybrid
tests is to keep the `wgpu` and `webgl` renderer backends in sync.
### Test plan
This PR changes no business logic and is the test.
Note: Browser WebGL backend tests currently pass all of the same tests
as the vello_hybrid wgpu renderer. Can be seen in CI here:
https://github.com/linebender/vello/actions/runs/15211363959/job/42786078261?pr=1020
I tested the functionality of this change by introducing intentional
breakages and ensuring that headless tests failed, and diff images could
be found on the browser when run without headless.
### Risks
I'm not sure of any risks as this isn't user facing.
### Manually testing this change
Pull branch down locally. Then navigate the `vello_sparse_tests` and
run: `wasm-pack test --chrome --features webgl`. Navigate to the browser
URL and see 65 tests succeed.
### Followup work
#1026
#1025
---------
Co-authored-by: Daniel McNab <[email protected]>vello_sparse_tests (#1020)1 parent 8491dca commit 377cc3c
File tree
8 files changed
+313
-7
lines changed- .github/workflows
- sparse_strips
- vello_dev_macros/src
- vello_sparse_tests
- tests
8 files changed
+313
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
312 | 330 | | |
313 | 331 | | |
314 | 332 | | |
| |||
337 | 355 | | |
338 | 356 | | |
339 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
340 | 362 | | |
341 | 363 | | |
342 | 364 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
86 | 115 | | |
87 | 116 | | |
88 | 117 | | |
| |||
137 | 166 | | |
138 | 167 | | |
139 | 168 | | |
140 | | - | |
| 169 | + | |
141 | 170 | | |
142 | 171 | | |
143 | 172 | | |
| |||
161 | 190 | | |
162 | 191 | | |
163 | 192 | | |
| 193 | + | |
| 194 | + | |
164 | 195 | | |
165 | 196 | | |
166 | 197 | | |
| |||
177 | 208 | | |
178 | 209 | | |
179 | 210 | | |
180 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
181 | 229 | | |
182 | 230 | | |
183 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
31 | 50 | | |
32 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
| |||
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
365 | 418 | | |
366 | 419 | | |
367 | 420 | | |
| |||
0 commit comments