Skip to content

test(cli): the components fields test prints its text from the JSON run's response, one doctor run - #9284

Merged
cixzhang merged 1 commit into
mainfrom
fix/cli-doctor-props-fields-one-run
Nov 1, 2026
Merged

cixzhang merged 1 commit into
mainfrom
fix/cli-doctor-props-fields-one-run

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

Main's Node tests are red, on the first run and on the re-run. doctor-integration.test.mjs › "components prints every field of the props comparison that JSON carries" timed out at Vitest's 30 s limit (35 s, then 37 s). It took 17–19 s on main even before the wider sharding (#9207). A busy test job pushes it over the limit and blocks every push's test gate on unrelated work.

Intended invariant

Unchanged: the components report's text names every field its JSON carries (each finding's component, prop and kind; each unchecked component's reason; each type not compared), with the same findings and summary lines. The response-type reference names every field too.

Change

The test ran the whole doctor integration components command twice, once with --json and once for text. Each run starts the project's TypeScript to compare props, which is most of the cost. It now runs the command once with --json and prints the text from that same response with printIntegrationCheckResponse. Without --json, the command prints exactly that response through exactly that printer (printComponentConflicts). Every assertion is unchanged. The command's text path itself stays covered end to end by the other components tests in the file, such as "components says documented props match when they do". Test only: no product code and no Changeset.

Evidence

  • Failure before the change: Main run 41286533582 timed out at 35 s and again at 37 s on its re-run. Locally the original takes 17.3 s.
  • Success after the change: locally 8.3 s, about half.
  • Still mutation-sensitive: dropping reason from the printer's unchecked records (doctor.mjs) fails the test ({"component":"AcmeLonely",…,"reason":…}: expected undefined to be defined).
  • Product/runtime behavior verified unchanged: no source change.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/clients/cli/commands/doctor-integration.test.mjs (the target, plus the mutation check above).
  • prettier and eslint on the file are clean.

The Node-leg duration rebalance is a separate pull request; this one only makes the test itself cheaper.

Posted by Cindy's agent on her behalf.

…un's response, one doctor run

It ran the whole components check twice (JSON, then text), each starting
TypeScript, and timed out at 30 s on main's busier legs. It now runs once
with --json and prints the same response through printIntegrationCheckResponse,
the printer the command uses. Same assertions. Test only.
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 1, 2026 8:28am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 1, 2026
@astracat-bot

astracat-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 1, 2026, 8:34 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to merge. The test keeps every assertion and prints its text report through the same printer the command's text path uses, so it covers the same fields with one doctor integration components run instead of two. The speed-up and the mutation check described in the PR both hold, and the command's own text branch stays covered by "components prints no [ok] for props it could not compare".

[Automated review]

@cixzhang
cixzhang merged commit eae71cb into main Nov 1, 2026
51 checks passed
@cixzhang
cixzhang deleted the fix/cli-doctor-props-fields-one-run branch November 1, 2026 09:36

This branch was successfully deployed

1 active deployment
Preview — 8a58fb3a Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant