Repository navigation
test(cli): follow the smoke command's output destination - #12609
astracat-bot[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
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.tsxinstead 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.tsxfor the Core-only project. Verified: the CLI's destination rule for a project outside a Next app givessrc/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,:738and:748. - Claim: the destination comes from the printed command's last argument, with a
.tsxfile checked directly, a folder aspage.tsxand 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 atcli-global-mode-smoke.test.mjs:72fails 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.
PR Analysis Report🔎 Preview ·
|
| 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
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>
validation: ran
pnpm test:node .github/scripts/cli-global-mode-smoke.test.mjs --maxWorkers=1on Node 24.22.1 andnode node_modules/vitest/vitest.mjs run --project node .github/scripts/cli-global-mode-smoke.test.mjs --maxWorkers=1on Node 22.13.0; each passed all 6 tests.pnpm review:prereported 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.tsxThe harness checks
src/pages/settings/page.tsxinstead, reportswrote=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
.tsxfile directly; retainpage.tsxfor 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
templateDestinationimplementation confirms that the Core-only project getssrc/pages/settings.tsx.pnpm specs:forwas run for both changed paths and the final diff. Pre-review reports a clean merge and no findings.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.
Fixes failing test
68d41973d17478ed7e9405cbd8efd85a62e11f0d7cfd7b9405f1af85cbc7a51e:cli-minimum-node.yml (schedule) / smoke > Global-mode smoke on Node 22.13.0.