test: add test coverage for cmd/oras/internal/display/metadata/text/blob* handlers#1861
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1861 +/- ##
==========================================
+ Coverage 85.33% 85.36% +0.02%
==========================================
Files 143 143
Lines 6743 6743
==========================================
+ Hits 5754 5756 +2
+ Misses 703 701 -2
Partials 286 286 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com>
c175716 to
9f224d3
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive test coverage for the blob metadata text handlers in the ORAS CLI that were previously untested. The handlers are responsible for formatting text output during blob push and delete operations.
- Adds complete test coverage for
BlobPushHandlerincluding constructor validation, output formatting, and digest display - Adds complete test coverage for
BlobDeleteHandlerincluding constructor validation and output formatting for missing/deleted blobs - Tests cover various scenarios including registry/OCI layout targets, different reference formats, and error handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| blob_push_test.go | Adds comprehensive tests for BlobPushHandler covering constructor, OnBlobPushed, and Render methods |
| blob_delete_test.go | Adds comprehensive tests for BlobDeleteHandler covering constructor, OnBlobMissing, and OnBlobDeleted methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…bcd1234 Co-authored-by: shizhMSFT <32161882+shizhMSFT@users.noreply.github.com>
|
I guess this requires review from @Wwwsylvia as the copilot added commits on my behalf. |
…lob* handlers (oras-project#1861) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com> Co-authored-by: shizhMSFT <32161882+shizhMSFT@users.noreply.github.com> Co-authored-by: Terry Howe <terrylhowe@gmail.com> Signed-off-by: ManishhDev <codermanishhh@gmail.com>
…lob* handlers (oras-project#1861) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com> Co-authored-by: shizhMSFT <32161882+shizhMSFT@users.noreply.github.com> Co-authored-by: Terry Howe <terrylhowe@gmail.com> Signed-off-by: ManishhDev <codermanishhh@gmail.com>
This PR adds comprehensive test coverage for the blob metadata text handlers that were previously untested. The blob handlers are responsible for formatting text output during blob push and delete operations in the ORAS CLI.
Changes Made
New Test Files Added
blob_push_test.go- Complete test coverage forBlobPushHandlerblob_delete_test.go- Complete test coverage forBlobDeleteHandlerTest Coverage Achieved
All blob handler functions now have 100% test coverage:
BlobPushHandler:
NewBlobPushHandler- Constructor validationOnBlobPushed- Output formatting for successful blob pushesRender- Digest display formattingBlobDeleteHandler:
NewBlobDeleteHandler- Constructor validationOnBlobMissing- Output formatting when blob is missingOnBlobDeleted- Output formatting for successful blob deletionsTest Scenarios Covered
The tests follow the existing project patterns and conventions, using the same testing infrastructure as other handlers in the package (like
push_test.goandrestore_test.go).Recent Updates
sha256:abcd1234with real digestsha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08in blob_delete_test.goFixes #1860.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.