chore: sort files before deleting duplicates #10
Merged
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.
We have a step to delete duplicate SVGs from inside the directory. The problem is that depending on the order that
find
returned files in, which one actually got deleted could vary.When all tests pass, this doesn't matter. But when we have the file in one of our files lists (
expect-mismatch
,ignore
, orskip
), then it can be a problem if the in subsequent builds of the Test Suite a different duplicate was deleted.Adds
sort
to increase the reproducibility of SVGO Test Suite.I believe this was the cause of sometimes new files being "fixed" or "breaking" randomly, it's when one of the known files that break end up with a new name.
An alternative fix could've been to simply name all files after their MD5 hash, but these solutions seem to be enough. It's nice to be able to refer to files by name anyway, and is better to be able to attribute a file by name too.