-
Notifications
You must be signed in to change notification settings - Fork 107
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
feat(fw): Add sha256 hash to fixtures #454
Conversation
Really nice! Played around with this today - I plan to rebase the fixture diff PR onto this branch tomorrow and use:
To create the fixture hash tree within #443. As these are tightly coupled I'll maybe make a PR here, where we have all the "hashing" related logic within the hasher. This would leave the "differ" to solely focus on comparisons. I added the info hash to some framework tests here: marioevz#16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Docs are really nice
🗒️ Description
Adds sha256 hash calculation to all generated fixtures, by simply converting to JSON string, with ordered keys and without
_info
, then hashing the string.I benchmarked all algorithms that hashlib provides using this: https://github.com/SharkyRawr/python-hashlib-benchmark
and surprisingly sha256 was among the fastest ones (I thought it would be md5 but it turns out it's not).
It also adds a nice script that prints the hashes in several forms, the
hasher
entry-point (see more withhasher -h
).🔗 Related Issues
None
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.