Repository navigation
test(display): cover the remaining JSON metadata handlers - #2266
Merged
TerryHowe merged 1 commit intoOct 21, 2026
Merged
Conversation
Add tests for the attach, discover, manifest fetch, repo ls and repo tags JSON handlers, which had none. They check the rendered output, including a nested referrer tree, a referrer whose subject was never discovered, non-JSON manifest content reported as null, and empty repository and tag lists rendered as [] rather than null. This raises coverage of display/metadata/json from 41.2% 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:54
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2266 +/- ##
==========================================
+ Coverage 60.08% 60.66% +0.57%
==========================================
Files 140 140
Lines 6091 6091
==========================================
+ Hits 3660 3695 +35
+ Misses 2209 2174 -35
Partials 222 222 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Thanks! |
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 the five JSON metadata handlers in
cmd/oras/internal/display/metadata/jsonthat had none: attach, discover, manifest fetch, repo ls and repo tags. The tests check the rendered JSON, including:null[]rather thannullThis raises coverage of the package from 41.2% to 100%. Test-only change, following the earlier
test(display)PRs.Which issue(s) this PR fixes:
N/A
Please check the following list: