Add test coverage for delegated hash bins#1808
Add test coverage for delegated hash bins#1808jku merged 1 commit intotheupdateframework:developfrom
Conversation
jku
left a comment
There was a problem hiding this comment.
marking request changes so it's visible on PR list: we talked about this over zoom, and found two issues: ivana promised a refactor at some point
1315507 to
191728a
Compare
Pull Request Test Coverage Report for Build 1878475404Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
191728a to
26b40e5
Compare
|
There are still some problems here:
The test should assert the same things The complication with this is that while DelegationsTestCase defines This is outside of scope for this PR but in case it makes the intent clearer: What DelegationsTestCase maybe should do is define a dict of target_paths and visited_orders: in your path_hash_prefixes cases the search results would look like because with your test data you will only get a single delegated role for every search. |
5c20029 to
541c515
Compare
jku
left a comment
There was a problem hiding this comment.
Thank you, this looks much better. I have two issues left but I'm starting to think they may be for follow up issues:
- The purpose of TestDelegation was to make the test case definition short. These are now ridiculously long, 14 lines per delegation or 50 lines for a single test case.
- The test does not actually check that target lookups lead to the correct metadata file downloads, it only checks that after three lookups, all three are downloaded (so we could e.g. have a bug where we download all three on the first lookup, and would not notice that)
I think we could leave those for later PRs... but I did make a suggestion on how to make the TestDelegation shorter in lines (it could also cover all hashes and not just a small subset). Let me know if you'd like to still handle that here or not.
541c515 to
d17a44f
Compare
jku
left a comment
There was a problem hiding this comment.
Oh yeah, much more readable. Thanks
Please fix the delegation role names, they don't currently make any sense (this does not affect the test functionality but I think the current names mislead the reader). This should trigger the the CI as well
This change adds tests coverage for `path_hash_prefixes` and verifies that role names matching specific prefixed successfully find and download the corresponding metadata files Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
d17a44f to
59245a2
Compare
This change adds tests coverage for
path_hash_prefixesandverifies that role names matching specific prefixed successfully
find and download the corresponding metadata files
Fixes #1639