fix(test): align mock latest result schema - #290
Conversation
WalkthroughThe LatestResult contract validator now requires ChangesLatestResult schema migration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
zeshi-du
left a comment
There was a problem hiding this comment.
Approving and merging.
One amendment I've made to the description: added Closes #255 alongside Closes #287. Those two issues are the same defect — the mock backend and the contract fixtures both model LatestResult as {passed, failed, skipped} while the real CliLatestResult carries verdict / executionStatus / a string summary, so the "strict" contract test was green against a shape the renderer no longer supports. #255 was filed first (by me, on 07-16) and #287 is the independent rediscovery; without the extra keyword #255 would have silently survived this merge.
Also worth saying: your other PR, #289, is closed as superseded — the test diff exit-contract bug it fixed had already been fixed internally 8 days before the issue that prompted it was filed. That's a publishing gap on our side and nothing you could have seen from the public repo. Thanks for both.
Summary
Align the mock-backend LatestResult fixtures and P4 contract validator with the current public
CliLatestResultshape.Root cause
The dry-run producer and public type already use the current semantic schema:
verdictexecutionStatussummaryThe mock backend fixtures and P4 validator still taught the old shape where
summarywas a{ passed, failed, skipped }object andverdict/executionStatuswere absent. That lets stale mock responses pass contract tests while rendering malformed text such assummary: [object Object].Change
verdictandexecutionStatus.summaryas a string.Validation
npm test -- test/contract/p4-schema.test.ts test/mock-backend/handlers.smoke.test.tsnpm run typechecknpm run lintnpm run format:checkAll checks passed locally on Node v24.15.0 / npm 11.12.1.
Closes #287
Summary by CodeRabbit
Tests
Test Fixtures
Closes #255 (same defect, filed earlier — see review comment).