Repository navigation
test: verify push display handler calls - #2293
Conversation
Signed-off-by: TanvirTian <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2293 +/- ##
==========================================
+ Coverage 61.85% 70.40% +8.54%
==========================================
Files 140 154 +14
Lines 6098 6329 +231
==========================================
+ Hits 3772 4456 +684
+ Misses 2102 1607 -495
- Partials 224 266 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hey @TerryHowe , I've updated this PR and will work on the remaining tasks. Feel free to share any feedback or review. Thanks! |
TerryHowe
left a comment
There was a problem hiding this comment.
Issue #2281: shared recording fakes package (display/displaytest) is not addressed.
Issue #2281: unit tests for uncovered metadata/text, status text/tty and discard handlers are not addressed.
Issue #2281: converting remaining commands and migrating output assertions out of pull_test.go, manifest/fetch_test.go, cp_test.go is not addressed.
Issue #2281 is only partly fixed — use "Refs #2281" or finish the remaining plan items.
Signed-off-by: TanvirTian <[email protected]>
346897d to
659c706
Compare
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
|
@TerryHowe , the PR is ready for review. Please let me know if there are is any issues. Thanks 🐈 |
|
I’m doing a final pass against the original issue to verify a few remaining items around command injection seams and factory test coverage. I’ll address any confirmed gaps and wrap things up shortly. |
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
c83879f to
ad10760
Compare
Signed-off-by: TanvirTian <[email protected]>
ad10760 to
a6c4ca8
Compare
|
Hi @TerryHowe, I've made the changes you asked for and updated the tests. Thanks for your feedback 🐕 |
Replace the optional `injected ...X` parameters and newXHandler(s) dispatch helpers with doX(ctx, ..., statusHandler, metadataHandler) functions that runX calls after building the real handlers. Tests call doX directly with displaytest fakes. - attach, backup, restore, discover, repo ls, repo tags and manifest push get new doX helpers; tag, resolve, blob delete and manifest delete rename their existing helpers to doX - backup and restore tests now run a real backup from an in-memory source and a real restore from a tar, asserting the handler call order - drop tests that only exercised fakes or the removed dispatch helpers; handler_test.go already covers the display factories - move the manifest delete and repo ls recorders into displaytest - assert only the stable start and end of the attach call sequence - restore a blank line in push.go removed as unrelated churn Signed-off-by: Terry Howe <[email protected]>
Add unit tests for the status handlers that had no coverage: - text: manifest push, blob push, manifest index create and update, TrackTarget for push and pull, Start/StopTracking for copy and blob push, and the attach handler constructor - tty: push OnCopySkipped and PreCopy, pull OnNodeRestored and OnNodeSkipped, backup and restore StopTracking, and the blob push handler The tty tests use a recording tracked target, so they check which progress state each handler reports instead of only checking for nil errors. Coverage of the status package goes from 73.3% to 93.6%. Signed-off-by: Terry Howe <[email protected]>
Blob delete now requires the reference to be a digest (oras-project#2304), so the placeholder references sha256:missing and sha256:1234 fail validation before the handler is called. Use real digests instead. Signed-off-by: Terry Howe <[email protected]>
What this PR does / why we need it:
This PR updates the display handler tests to check handler calls instead of printed output.
It adds shared test helpers to record handler calls and updates the affected command tests to use them. This makes the tests easier to read and check.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fix #2281
Please check the following list: