Kompari xtask (html report, interactive test blessing, dead snapshots detection)#272
Kompari xtask (html report, interactive test blessing, dead snapshots detection)#272spirali merged 13 commits intolinebender:mainfrom
Conversation
2b99f07 to
78a3551
Compare
There was a problem hiding this comment.
Very cool! I made some tests intentionally fail subtly, and I think this will definitely help with e.g. spotting when there are actual issues vs just rounding differences.
Some minor nits inline, and I think you intended to commit .cargo/config.toml or something similar, I added a comment about that on parley/tests/README.md.
Cargo.lock
Outdated
| [[package]] | ||
| name = "accesskit" | ||
| version = "0.17.0" | ||
| version = "0.17.1" |
There was a problem hiding this comment.
I believe according to https://github.com/linebender/rfcs/blob/main/rfcs/0005-version-matrix.md#cargotoml-matches-cargolock, Cargo.toml should be updated to match these patch versions.
There was a problem hiding this comment.
It should be fixed now by running cargo upgrade
There was a problem hiding this comment.
I'm not sure, for example Cargo.toml still lists accesskit = "0.17", but it's locked to "0.17.1" in the lockfile.
Maybe @DJMcNab can chime in?
There was a problem hiding this comment.
We should always specify the patch version in Cargo.toml, yes. So we never should have a dependency of the form accesskit = "0.17".
That's largely a thing for consistency, but it does have advantages for e.g. when we publish, largely in case any user decides to use the MSRV-aware resolver or minimal-versions.
| let args = Args::parse(); | ||
| let mut diff_config = DirDiffConfig::new(snapshots_path, current_path); | ||
| diff_config.set_ignore_right_missing(true); | ||
| let actions = ActionsImpl(); | ||
| let mut task = Task::new(diff_config, Box::new(actions)); | ||
| task.run(&args)?; |
There was a problem hiding this comment.
Would it make sense to move more of this into kompari_tasks? If more repositories use Kompari, they'd all duplicate this code.
There was a problem hiding this comment.
This was the original plan, but I still want to have a relatively high level of configurability, as it seems that the Vello testing framework works a bit differently than what I implemented for Parley.
Cargo.lock
Outdated
| [[package]] | ||
| name = "accesskit" | ||
| version = "0.17.0" | ||
| version = "0.17.1" |
There was a problem hiding this comment.
I'm not sure, for example Cargo.toml still lists accesskit = "0.17", but it's locked to "0.17.1" in the lockfile.
Maybe @DJMcNab can chime in?
|
Kompari updated. It adds |
DJMcNab
left a comment
There was a problem hiding this comment.
I'm happy to just land this; I think there are more improvements to be made (such as using Kompari's diff algorithm internally, which I don't think this does). But it's important to keep this project moving.
All review comments are addressed, as far as I know
Co-authored-by: Tom Churchman <thomas@kepow.org>
7d1c444 to
51176a3
Compare
DJMcNab
left a comment
There was a problem hiding this comment.
The concern about CI checking for xtask is blocking concern, but otherwise this is looking really good
.github/workflows/ci.yml
Outdated
|
|
||
| - name: cargo clippy | ||
| run: cargo hack clippy --workspace --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std -- -D warnings | ||
| run: cargo hack clippy --package parley --package fontique --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std -- -D warnings |
There was a problem hiding this comment.
Hmm. Why do we want to not run clippy on the xtask code itself? Is it just how much longer it takes (since it needs to check axum, etc.), or something else?
There was a problem hiding this comment.
I am disabling it only for andoid, as kompari does not compile there because of:
Compiling libdeflate-sys v1.23.1
warning: libdeflate-sys@1.23.1: Compiler family detection failed due to error: ToolNotFound: failed to find tool "x86_64-linux-android-clang": No such file or directory (os error 2)
error: failed to run custom build command for `libdeflate-sys v1.23.1`
There was a problem hiding this comment.
Ah - that's unfortunate, but not too important at the moment.
Can this instead be --workspace --exclude xtask?
There was a problem hiding this comment.
Thanks. I was looking for something like this in the documentation and could not find it so I have named the packages.
| ```bash | ||
| cargo xtask report # Creates report | ||
| cargo xtask review # Interactive test blessing | ||
| cargo xtask dead-snaphosts # Detects dead snapshots |
This PR adds xtask similar to linebender/parley#272 for Parley. Because Vello has two types of tests: snapshots and comparisons (cpu vs. gpu), xtask is divided to two subcommands: ``` cargo xtask snapshots ... cargo xtask comparisons ... ``` The first one offers all Kompari's functionality (report, review, size-check, dead-snapshots detection). The second one offers only report as others do not make sense. Btw1: Current size check output:  Btw2: Current dead snapshots report (This may be broken as some tests are skipped on my machine) ``` /home/ada/projects/vello/vello_tests/current/big_bitmap.png /home/ada/projects/vello/vello_tests/current/big_bitmap_apple.png /home/ada/projects/vello/vello_tests/current/big_colr.png /home/ada/projects/vello/vello_tests/current/bitmap_undef.png /home/ada/projects/vello/vello_tests/current/blurred_rounded_rect.png /home/ada/projects/vello/vello_tests/current/colr_undef.png /home/ada/projects/vello/vello_tests/current/deep_blend.png /home/ada/projects/vello/vello_tests/current/fill_types.png /home/ada/projects/vello/vello_tests/current/funky_paths.png /home/ada/projects/vello/vello_tests/current/gradient_extend.png /home/ada/projects/vello/vello_tests/current/image_extend_modes_bilinear.png /home/ada/projects/vello/vello_tests/current/image_extend_modes_nearest_neighbor.png /home/ada/projects/vello/vello_tests/current/image_sampling.png /home/ada/projects/vello/vello_tests/current/integer_translation.png /home/ada/projects/vello/vello_tests/current/little_bitmap.png /home/ada/projects/vello/vello_tests/current/little_colr.png /home/ada/projects/vello/vello_tests/current/longpathdash_butt.png /home/ada/projects/vello/vello_tests/current/many_clips.png /home/ada/projects/vello/vello_tests/current/non_integer_translation.png /home/ada/projects/vello/vello_tests/current/rounded_rectangle_watertight.png /home/ada/projects/vello/vello_tests/current/scaled_hinted.png /home/ada/projects/vello/vello_tests/current/simple_hinted.png /home/ada/projects/vello/vello_tests/current/smoke/data_image_roundtrip.png /home/ada/projects/vello/vello_tests/current/smoke/filled_circle.png /home/ada/projects/vello/vello_tests/current/smoke/filled_square.png /home/ada/projects/vello/vello_tests/current/smoke/two_emoji.png /home/ada/projects/vello/vello_tests/current/splash.png /home/ada/projects/vello/vello_tests/current/stroke_styles.png /home/ada/projects/vello/vello_tests/current/stroke_styles_non_uniform.png /home/ada/projects/vello/vello_tests/current/stroke_styles_skew.png /home/ada/projects/vello/vello_tests/current/tricky_strokes.png ```
Adds command
cargo xtaskthat allows to:Creating report
creates HTML file with report containing snapshots that does not match
Interactive test blessing:
stars a local web server with the following page:
(screenshot obtained by putting an artificial error into each snapshot test)

Detecting dead snapshots
This PR fully replaces #185