Repository navigation
test(contentutil): cover MultiReadOnlyTarget and IsDigest - #2267
Merged
Merged
Conversation
MultiReadOnlyTarget and IsDigest had no tests. Cover the lookup order of Fetch and Resolve: they fall through targets that report not found, stop at the first other error without consulting later targets, and return not found when no target has the content. Also check that Exists reports an error without consulting any target, and table-test IsDigest, including digests of the wrong length or case. This raises coverage of internal/contentutil from 21.4% to 100%. Signed-off-by: Akshita <[email protected]>
akshita317
requested review from
TerryHowe,
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
October 20, 2026 16:55
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2267 +/- ##
==========================================
+ Coverage 60.08% 60.23% +0.14%
==========================================
Files 140 140
Lines 6091 6091
==========================================
+ Hits 3660 3669 +9
+ Misses 2209 2201 -8
+ Partials 222 221 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Adds tests for
MultiReadOnlyTargetandIsDigestininternal/contentutil, which had none:FetchandResolvefall through targets that report not found, stop at the first other error without consulting later targets, and return not found when no target (or no target at all) has the contentExistsreturns an error without consulting any target, since it is not implementedIsDigesttable test, including digests of the wrong length or caseThis raises coverage of the package from 21.4% to 100%. I also checked that the tests are not vacuous: making
Fetchignore non-not-found errors failsTestMultiReadOnlyTarget_Fetch. Test-only change.Which issue(s) this PR fixes:
N/A
Please check the following list: