Page MenuHomeSoftware Heritage

Draw contents from a byte string instead of generating arbitrary hashes
ClosedPublic

Authored by olasd on Mar 2 2020, 2:07 PM.

Details

Summary

This generates more realistic contents and avoids spurious HashCollisions when
generating a set of objects using these hypothesis strategies, at the cost of
slightly worse "boundary checking" (i.e. we won't check contents with a length >
4096 bytes).

Depends on D2738.

Test Plan

tox tests still pass

Diff Detail

Repository
rDMOD Data model
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10841
Build 16289: tox-on-jenkinsJenkins
Build 16288: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 2 2020, 2:12 PM
swh/model/hypothesis_strategies.py
152

Maybe use the swh.model.hashutil.DEFAULT_ALGORITHMS variable?

swh/model/hypothesis_strategies.py
152

The list of attributes is somewhat hardcoded in swh.model.model, so I elected not to do that.