Skip to content

fix(test): align mock latest result schema#290

Open
zengxm1979 wants to merge 1 commit into
TestSprite:mainfrom
zengxm1979:codex/fix-latest-result-mock-schema-287
Open

fix(test): align mock latest result schema#290
zengxm1979 wants to merge 1 commit into
TestSprite:mainfrom
zengxm1979:codex/fix-latest-result-mock-schema-287

Conversation

@zengxm1979

@zengxm1979 zengxm1979 commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Align the mock-backend LatestResult fixtures and P4 contract validator with the current public CliLatestResult shape.

Root cause

The dry-run producer and public type already use the current semantic schema:

  • verdict
  • executionStatus
  • string summary

The mock backend fixtures and P4 validator still taught the old shape where summary was a { passed, failed, skipped } object and verdict / executionStatus were absent. That lets stale mock responses pass contract tests while rendering malformed text such as summary: [object Object].

Change

  • Update running, passed, failed, and no-analysis mock result fixtures to include verdict and executionStatus.
  • Replace count-object summaries with human-readable string summaries.
  • Update the P4 LatestResult validator to require the current fields and validate summary as a string.

Validation

  • npm test -- test/contract/p4-schema.test.ts test/mock-backend/handlers.smoke.test.ts
  • npm run typecheck
  • npm run lint
  • npm run format:check

All checks passed locally on Node v24.15.0 / npm 11.12.1.

Closes #287

Summary by CodeRabbit

  • Tests

    • Updated latest-result contract validation to require verdict and execution status fields.
    • Added validation for supported verdict and execution status values.
    • Updated summary validation to use human-readable text.
  • Test Fixtures

    • Refreshed sample results to include verdict, execution status, and descriptive summaries across running, passed, failed, and no-analysis scenarios.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c113d7f-0907-4868-8bd1-040f1126a631

📥 Commits

Reviewing files that changed from the base of the PR and between fe07bc9 and 1aa9403.

📒 Files selected for processing (2)
  • test/contract/p4-schema.test.ts
  • test/mock-backend/fixtures.ts

Walkthrough

The LatestResult contract validator now requires verdict and executionStatus, validates their allowed values, and expects a string summary. Mock fixtures are updated from count objects to the corresponding semantic result fields.

Changes

LatestResult schema migration

Layer / File(s) Summary
LatestResult contract validation
test/contract/p4-schema.test.ts
The validator requires and checks verdict and executionStatus, while validating summary as a string instead of a numeric count object.
Mock LatestResult fixtures
test/mock-backend/fixtures.ts
Running, passed, failed, and no-analysis fixtures now provide semantic verdicts, execution statuses, and descriptive summaries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • #255 — Updates the obsolete LatestResult schema in the same fixtures and contract validator.

Suggested reviewers: ruili-testsprite, zeshi-du

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating test mocks to match the latest result schema.
Linked Issues check ✅ Passed The fixtures and contract validator now use verdict, executionStatus, and string summaries, matching the linked migration goal.
Out of Scope Changes check ✅ Passed The changes stay focused on the LatestResult schema migration in tests and fixtures, with no unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repository mock and contract producers must be migrated to the current LatestResult representation used by the public type and dry-run producer

1 participant