Add manifest tests
Fixes #1863
Added unit tests for manifest_delete.go, manifest_index.go and manifest_push.go. These were missing test coverage so I wrote tests covering all the main methods in each handler.
Tests include:
- ManifestDeleteHandler methods (OnManifestMissing, OnManifestDeleted)
- ManifestIndexCreateHandler methods (OnTagged, OnIndexCreated, Render)
- ManifestPushHandler methods (OnTagged, OnManifestPushed, Render)
What this PR does / why we need it: Adds missing test coverage for the manifest handlers to help catch bugs and make the code more reliable.
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1863
Please check the following list:
- [x] Does the affected code have corresponding tests, e.g. unit test, E2E test?
- [ ] Does this change require a documentation update?
- [ ] Does this introduce breaking changes that would require an announcement or bumping the major version?
- [x] Do all new files have an appropriate license header?
Hi, All checks have passed and the PR is ready for review. Could a code owner please take a look and approve for merging? Thanks!
Ignore those copilot comments. That looks like the given-when-then pattern to me pretty much.
Something wrong with the build, see the logs, but a sample:
Error: cmd/oras/internal/display/metadata/text/manifest_delete_test.go:27:79: too many arguments in call to output.NewPrinter
have (*bytes.Buffer, *bytes.Buffer, bool)
want (io.Writer, io.Writer)
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days.