Skip to content

test(cli): follow the smoke command's output destination - #12609

Closed
astracat-bot[bot] wants to merge 1 commit into
mainfrom
codebunny/fix/test-cli-follow-the-smoke-command-s-output-destination-4c951e
Closed

astracat-bot[bot] wants to merge 1 commit into
mainfrom
codebunny/fix/test-cli-follow-the-smoke-command-s-output-destination-4c951e

Conversation

@astracat-bot

@astracat-bot astracat-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

validation: ran pnpm test:node .github/scripts/cli-global-mode-smoke.test.mjs --maxWorkers=1 on Node 24.22.1 and node node_modules/vitest/vitest.mjs run --project node .github/scripts/cli-global-mode-smoke.test.mjs --maxWorkers=1 on Node 22.13.0; each passed all 6 tests. pnpm review:pre reported 0 findings.

Maintainer impact

The minimum-Node smoke job fails despite the printed template command exiting successfully. In run 44258944787, job 134648576567, 31 checks pass and the only failure is the Core-only project's printed command:

npx @astryxdesign/[email protected] template settings --type page src/pages/settings.tsx

The harness checks src/pages/settings/page.tsx instead, reports wrote=false, and fails the job. Its existing regression fixture models only a directory destination, so it misses the concrete-file case.

Intended invariant

Keep executing the command exactly as printed and require success, the generated file, and the expected answering release. AST-081 FR5 owns the printed command's release selection. No behavior change to the CLI, its public API, or its supported Node floor.

Change

Read the destination from the printed command's final argument. Check a concrete .tsx file directly; retain page.tsx for a directory destination and the generated destination for the outside-project <path> placeholder. Clean up only the concrete file, not its parent directory, so sibling files remain intact.

Extend the existing regression helper to cover both concrete-file and directory destinations, a second file name, sibling preservation, missing output despite exit 0, and the wrong answering release outside a project. No assertion, timeout, or retry is relaxed.

Evidence

  • Before the script change, the two added file-destination cases failed in both local runs; the four remaining cases passed.
  • After the change, all 6 cases passed on Node 24.22.1 and Node 22.13.0.
  • A direct check of the existing templateDestination implementation confirms that the Core-only project gets src/pages/settings.tsx.
  • pnpm specs:for was run for both changed paths and the final diff. Pre-review reports a clean merge and no findings.
  • CI impact: no workflow, runner, job, invocation, or timeout changes. The existing smoke check uses the correct destination; the unit file adds three cases.

The full registry-backed smoke command was not rerun locally because repository execution cannot access the public registry. The local tests replay the actual smoke section with process execution stubbed; they validate the harness and its negative checks, not an end-to-end npm/npx install. The fixtures use unquoted relative destinations, as the failing command does.

Scope

Components: none. Changed files are the smoke script and its colocated tests only.

  • 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.

Fixes failing test 68d41973d17478ed7e9405cbd8efd85a62e11f0d7cfd7b9405f1af85cbc7a51e: cli-minimum-node.yml (schedule) / smoke > Global-mode smoke on Node 22.13.0.

@vercel

vercel Bot commented Nov 18, 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 18, 2026 8:17am UTC

Request Review

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

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

AI review status for this pull request.

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

@astracat-bot astracat-bot Bot left a comment •

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.

Approved: CI passes on this head.

The smoke harness now checks the file that the printed template command writes, and it keeps sibling files when that destination is a file. The new regression cases fail against the old harness and pass with this change, and every claim in the description checks out. Nothing else is needed from the author.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the minimum-Node smoke job fails only on the Core-only project's printed command, which exits 0 while the harness finds no file. Verified: the scheduled job's log shows 31 passing checks and that one failure, with exit 0 and no file found.
  • Claim: the harness looks for src/pages/settings/page.tsx instead of the printed file. Verified: the old harness hard-codes that target for every in-project command.
  • Claim: the old regression fixture models only a folder destination. Verified: it used src/pages/settings.
  • Claim: the CLI names src/pages/settings.tsx for the Core-only project. Verified: the CLI's destination rule for a project outside a Next app gives src/pages/<id>.tsx, and a direct call on a Core-only fixture returns it.
  • Claim: the command still runs exactly as printed and must succeed, write the file and reach the expected release. Verified: cli-global-mode-smoke.mjs:721, :738 and :748.
  • Claim: the destination comes from the printed command's last argument, with a .tsx file checked directly, a folder as page.tsx and the placeholder as before. Verified: cli-global-mode-smoke.mjs:714-720.
  • Claim: cleanup removes only the concrete file, so sibling files stay. Verified: cli-global-mode-smoke.mjs:733-737; the sibling assertion at cli-global-mode-smoke.test.mjs:72 fails when cleanup removes the folder instead.
  • Claim: the helper covers file and folder destinations, a second file name, sibling preservation, missing output with exit 0, and another release answering outside a project. Verified: cli-global-mode-smoke.test.mjs:18-108.
  • Claim: no assertion, timeout or retry is relaxed. Verified: the pass condition and the 300-second timeout are unchanged, and the test assertions only take the destination as a parameter.
  • Claim: before the fix the two file-destination cases fail and the other four pass. Verified: the new test file against the old harness fails exactly those two.
  • Claim: all six cases pass after the change. Verified on Node 24 (six of six) and in CI's Node test shards; the Node 22 run was not repeated.
  • Claim: the pre-review check reports no findings and a clean merge. Verified.
  • Claim: no change to the CLI, its public API or its Node floor, and only the smoke script and its colocated test change. Verified from the file list.
  • Claim: CI impact is no workflow, runner, job, invocation or timeout change, and the unit file adds three cases. Verified: no workflow changes, and the file grows from three to six cases.
  • Claim: the local tests stub process execution and use unquoted relative destinations, as the failing command does. Verified: cli-global-mode-smoke.test.mjs:41-64.
  • Claim: this fixes the failing minimum-Node smoke on Node 22.13.0. Verified for the harness logic against the CLI's write rule; the registry-backed run is the next scheduled one.
  • File .github/scripts/cli-global-mode-smoke.mjs: clear.
  • File .github/scripts/cli-global-mode-smoke.test.mjs: clear.

Automated review (maintainer link)

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ad35f0d

Storybook · Sandbox · built from this PR's head

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

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

CI impact: 0 job-min per update · pool 0% · time to green −42.4 min · standard runners · 2 CI action or script files changed (not measured)
Before After Change
Job-minutes per PR update 219 219 0
Runner pool, runner-minutes a day 71,349 71,349 0 (0%)
Average concurrent jobs 49.5 49.5 0
Time to green (median → this run) 64.5 min 22.1 min −42.4 min
Runs a day 326 326 0

Not measured (the jobs that use these keep their recent minutes above): .github/scripts/cli-global-mode-smoke.mjs, .github/scripts/cli-global-mode-smoke.test.mjs.

Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.


Generated by PR Enrichment workflow | View full report

cixzhang added a commit that referenced this pull request Nov 18, 2026
test(cli): follow the smoke command's output destination

Re-cut of #12609 by astracat-bot, byte-identical.

Co-authored-by: astracat-bot[bot] <astracat-bot[bot]@users.noreply.github.com>
@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) Thanks for this fix to the CLI smoke script's output destination. It landed unchanged in #12610 (merged as 9de1980), so this pull request is closed as superseded.

@cixzhang cixzhang closed this Nov 18, 2026
@github-actions
github-actions Bot deleted the codebunny/fix/test-cli-follow-the-smoke-command-s-output-destination-4c951e branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — ad35f0d8 Deployed Nov 18, 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