oras icon indicating copy to clipboard operation
oras copied to clipboard

Add manifest tests

Open ManishhDev opened this issue 2 months ago • 3 comments

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?

ManishhDev avatar Oct 22 '25 15:10 ManishhDev

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!

ManishhDev avatar Oct 22 '25 19:10 ManishhDev

Ignore those copilot comments. That looks like the given-when-then pattern to me pretty much.

TerryHowe avatar Oct 23 '25 16:10 TerryHowe

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)

TerryHowe avatar Oct 23 '25 20:10 TerryHowe

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.

github-actions[bot] avatar Dec 15 '25 02:12 github-actions[bot]