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.
Following up on a suggestion from #61 (comment) this PR adds some black box visual regression tests that compare the images generated by squint against reference images using pixelmatch.
Example output from passing tests:
Example output with failing test:
and also the image diffs for any cases that failed will be saved to a build artifact. Example image diff:
I've pushed a commit that intentionally causes a failure and then reverted it so you can poke about in examples of both.
Some other thoughts:
docker build
step. It would be nice to see if we could improve this with a bit of caching. If we could cache the layers up toRUN apt update && apt install -y libgtk-3-dev
between builds that would give us some improvement, but anything beyond that is going to change every PR anyway so it is never going to be rapid. I haven't done anything about this yet.test_cases.json
and a corresponding image in/reference_images
. Add static page that displays badges #35 probably indicates a good selection of cases we could aim to cover, but I've decided to start small. Once the basics are in place, adding more cases is comparatively easy.Final note: The lint job is failing, but I think the failing lint check is unrelated to the changes in this PR.