Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests that check whether the input matches the output image data #12

Open
dloebl opened this issue Aug 14, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@dloebl
Copy link
Owner

dloebl commented Aug 14, 2021

As of now our tests only check whether the resulting file is a valid GIF image.
However, we should add tests that check whether the input image data matches the output image data.
To achieve this, we would need to pass the GIF image created to an actual GIF decoder.

Steps:

  1. Find a common, well-tested decoder (e.g. ImageMagick might be an option)
  2. Add a compare routine to all current tests (Note: multi-frame / transparent GIFs might be tricky)
@dloebl dloebl added the enhancement New feature or request label Aug 14, 2021
@lovell
Copy link
Contributor

lovell commented Aug 15, 2021

A possible solution to verifying actual vs expected output is to store the latter in the repo and ensure the compressed, binary data of both exactly match.

If a change to the logic alters the actual output then the expected output must change too. This means a human will manually review both the logic change and the expected output change at the same time (e.g. GitHub provides image diff tooling as part of the PR process).

@dloebl
Copy link
Owner Author

dloebl commented Sep 2, 2021

Thanks for the hint, Image diff tooling sounds interesting - I will have a look into this.
For now I would start with adding simple MD5 hashes for all test result GIFs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants