-
Notifications
You must be signed in to change notification settings - Fork 203
test: add test coverage for cmd/oras/internal/display/metadata/text/blob* handlers #1861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1861 +/- ##
==========================================
+ Coverage 85.32% 85.35% +0.02%
==========================================
Files 143 143
Lines 6739 6739
==========================================
+ Hits 5750 5752 +2
+ Misses 703 701 -2
Partials 286 286 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Co-authored-by: TerryHowe <[email protected]>
c175716
to
9f224d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
BlobPushHandler
including constructor validation, output formatting, and digest display - Adds complete test coverage for
BlobDeleteHandler
including 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…bcd1234 Co-authored-by: shizhMSFT <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I guess this requires review from @Wwwsylvia as the copilot added commits on my behalf. |
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 forBlobPushHandler
blob_delete_test.go
- Complete test coverage forBlobDeleteHandler
Test 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.go
andrestore_test.go
).Recent Updates
sha256:abcd1234
with real digestsha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
in 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.