Skip to content

test(cli): render, codemod and doctor fixtures live in the OS temp directory - #9899

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c17-r47-render-fixtures
Nov 4, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c17-r47-render-fixtures

Conversation

@vjeux

@vjeux vjeux commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Follows #9892, which added test-utils/linked-fixture.mjs.

Maintainer impact

Four more test files make fixture projects inside packages/cli, the tree scripts/check-cli-structure.mjs walks: the render API (api/render), the render time limit (foundation/render), the v0.3.0 authoring codemod's tsc check, and doctor's config checks. When a walk lists such a fixture and reaches it after the test has removed it, the check fails with ENOENT. With this change, no test makes a fixture inside packages/cli.

Intended invariant

The tests' assertions are unchanged, and each fixture's imports resolve as before. No product code changes.

Change

  • The render and codemod fixtures use makeLinkedFixture, which now links the CLI's own package by name, so @astryxdesign/cli resolves as itself. The codemod's tsconfig extends the repository's by its absolute path, and its fixture links the node and jest-dom types the root tsconfig names.
  • Doctor's config files import nothing, so they go to a plain temporary directory. Vitest imports a file from there today; the comment that said it could not is removed.

Evidence

test fixtures made inside packages/cli check:cli-structure before with this change
api/render 2 → 0 ENOENT exit 0
foundation/render 1 → 0 ENOENT exit 0
v0.3.0 authoring-migration.tsc 1 → 0 ENOENT exit 0
commands/doctor 3 → 0 exit 0 exit 0
  • The structure walk enters doctor's fixture folders too, but they exist too briefly for the evidence run to catch one, so no race shows there; they move all the same. Each test file passes in every run, on both arms.

  • Product/runtime behavior verified unchanged: test-only.

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

Local, at 6246d85 on main 6255d30 (Linux): the four files, test-utils/linked-fixture.test.mjs and scripts/check-cli-structure.test.mjs pass, 148 tests; prettier on the helper, pnpm lint on the changed files, and the Changeset coverage check (nothing ships). The four test files were not prettier-clean before, so their edits stay minimal.

@vercel

vercel Bot commented Nov 4, 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 4, 2026 11:09am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 4, 2026, 11:18 AM UTC

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

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 6246d85

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 8 rows, theme-butter 1 row, theme-chocolate 1 row, theme-gothic 1 row, theme-matcha 1 row, theme-neutral 1 row, theme-stone 1 row, theme-y2k 1 row; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet. This is a draft from a fork, so CI runs once it is marked ready for review and a maintainer adds the ci:run label.

Moving the CLI test fixtures into the OS temp directory looks right, and the approval covers both commits, including the #9892 change. The moved tests pass with unchanged assertions, check:cli-structure passes, and none of these tests leaves a fixture folder in packages/cli any more.

  • Non-blocking: the description says the structure walk never enters doctor's fixture folders, but allMjsFiles(CLI) in scripts/check-cli-structure.mjs does descend into clients/cli/commands; those folders just exist too briefly to race, so that sentence could be reworded.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one fix before this can merge.

  • Miss: the packages/cli/.gitignore edit makes the required lint job's Changeset coverage step (scripts/release/changeset-coverage.mjs pr) fail, because it counts that file as shipping in @astryxdesign/cli and no Changeset names the package; drop the .gitignore hunk (the stale entry is harmless) or add a Changeset naming @astryxdesign/cli.

Otherwise the move looks right: the four test files make no fixture inside packages/cli, the changed tests, the helper test and the structure test pass with unchanged assertions, and pnpm check:cli-structure passes. CI has not run on this head yet; it runs once the pull request is marked ready for review and a maintainer adds the ci:run label.

[Automated review]

Comment thread packages/cli/.gitignore
Comment on lines -16 to -19

# Transient fixture dir written by authoring-migration.tsc.test.mjs (runs the
# real tsc over migrated output); created + removed per test run.
.codemod-tsc-*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This hunk makes the required lint job's Changeset coverage step fail: scripts/release/changeset-coverage.mjs counts packages/cli/.gitignore as shipping in @astryxdesign/cli, and no Changeset names that package. Keeping the stale entry (it is harmless) keeps this pull request test-only; otherwise add a Changeset naming @astryxdesign/cli.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dropped the hunk in 6246d85: the stale entry stays, so this pull request stays test-only. The coverage step now passes: "nothing here ships to consumers".

…rectory

Four more test files made fixture projects inside packages/cli: the render
API and the render time limit (so React and the page's imports resolved),
the v0.3.0 authoring codemod's tsc check (so @astryxdesign/cli resolved as
itself), and doctor's config checks. That is the tree check-cli-structure
and other scanners walk, and a fixture can vanish in the middle of a walk.

The render and codemod fixtures use makeLinkedFixture, which now links the
CLI's own package by name. The codemod's tsconfig extends the repository's
by its absolute path. Doctor's config files import nothing, so they go to
a plain temporary directory: Vitest now imports a file from there.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet. This is a draft from a fork, so CI runs once it is marked ready for review and a maintainer adds the ci:run label.

Dropping the .gitignore hunk clears the earlier Changeset coverage failure, and the four test files now make no fixture inside packages/cli; the changed tests, the helper test and the structure test pass with unchanged assertions, and pnpm check:cli-structure passes.

  • Non-blocking: the description still says the structure walk never enters doctor's fixture folders, but allMjsFiles(CLI) in scripts/check-cli-structure.mjs does descend into clients/cli/commands; those folders just exist too briefly to race, so that sentence could be reworded.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 4, 2026 13:43
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 4, 2026
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 13:52
@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 13:52
@cixzhang
cixzhang merged commit 4d84e2d into meta:main Nov 4, 2026
150 of 155 checks passed
@vjeux
vjeux deleted the uikit/c17-r47-render-fixtures branch November 4, 2026 15:44

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) 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.

2 participants