Repository navigation
Commit eae3368
test(cli): dev-no-watch pin reports a failed child as itself and names pnpm's own PACKAGE refusal (#22712)
Fixes #22618
Clause-②: no
## What changed
One file, `packages/cli/test/dev-no-watch.pin.test.ts`. Test-only:
nothing in `packages/cli`'s `files[]` (`dist`, `README.md`,
`CHANGELOG.md`) changes.
- **`runDev` reports a failed child as itself.** `Run` now carries
`code: number | string | null` and `signal`, taken from `execFile`'s
error as it is handed back: the exit status when there is one; `null`
plus the signal for a signalled child; Node's own string code for a run
that never produced an exit status (a spawn error such as `EAGAIN`, or
`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`). Before this change all of those
read `1`.
- **Every spawned assertion prints the child's whole answer when it
fails.** `told(run)` is passed as vitest's `expect(value, message)`, so
a red reads `os dev ended with code …, signal …; its output (stdout,
then stderr): …` instead of only `expected 1 to be +0`. The control is
the case the card names. The siblings get the same message, because the
tightened sibling-1 assertion below would otherwise be a second
undiagnosable red.
- **Sibling 1 (`os dev --watch=false`) now names pnpm's own PACKAGE
refusal.** `dev.ts` has no sentence of its own for a PACKAGE that
selects nothing: `--fail-if-no-match` hands that answer to pnpm. On that
path the CLI's `✗` line (`Development mode failed: Command failed: pnpm
--filter false --fail-if-no-match dev`) is the catch-all for every
failure of `pnpm … dev`, so it names `false` whether or not pnpm ever
ran. The it-block now also asserts pnpm's own no-match line
(`PNPM_NO_PROJECTS`, `/^No projects found in "/m`) and keeps the `false`
check on the `✗` line.
⛔ No retry wrapper, no wider timeout, no product change. A real
regression stays red, and the red now says why.
## Measured
All runs are on this branch at `d38422340`. The CLI child is the test's
own (`tsx bin/run-dev.js dev`, the same fixture shapes, `NO_COLOR=1`).
**The card's sibling-1 claim, reproduced.** With pnpm off `PATH`, the
`--watch=false` child still exits 1 and prints the same `✗` line. The
only difference is that pnpm's own `No projects found in "DIR"` line is
missing (stdout, exit 1; the same under pnpm 10.28.0 and 10.31.0), and
`/bin/sh: 1: pnpm: not found` appears instead. Under the same `PATH` the
control's child also exits 1, which is the CI red's exact reading, and
only its stderr names pnpm.
"pnpm off `PATH`" means every `PATH` entry holding an executable `pnpm`
is dropped, including pnpm's self-managed
`~/.local/share/pnpm/.tools/pnpm/10.31.0/bin`, which `pnpm exec` puts on
`PATH`. A first attempt that removed only `/opt/node22/bin` still
resolved pnpm and ran 8/8 green. It does not count.
| run | input | result |
|---|---|---|
| R1 | normal `PATH` | 8/8 pass |
| R2 | pnpm off `PATH` | 2 fail, 6 pass: sibling 1's refusal assertion
(`os dev ended with code 1, signal null; …` then `/bin/sh: 1: pnpm: not
found`), and the control (the same message, then `expected 1 to be +0`)
|
| A1 | pnpm off `PATH`, the `PNPM_NO_PROJECTS` assertion deleted
(`scripts/ablation-replace.mjs`, anchor 1 to 0, blob `7e8e5de` to
`49986f4`) | 1 fail, 7 pass: sibling 1 is green again, so that one line
is what turns it red. Restored: blob equals HEAD, `git diff HEAD` empty
|
| M1 | `timeout: 1` added to `runDev`'s `execFile` options | 4 fail,
each reading `os dev ended with code null, signal "SIGTERM"`. Restored:
blob equals HEAD |
| M2 | `maxBuffer: 16` | 4 fail, each reading `code
"ERR_CHILD_PROCESS_STDIO_MAXBUFFER", signal null`. Restored: blob equals
HEAD |
A1, M1 and M2 are one-time proofs; no permanent test was added for them.
The subject under mutation is the test file itself, which vitest reads
from disk, so no `dist/` sits on that path.
## Local verification (at `d38422340`)
- `pnpm --filter @objectstack/cli exec vitest run --project integration
--maxWorkers=2 test/dev-no-watch.pin.test.ts`: 8/8 pass. The file is
integration-tier because it spawns.
- `pnpm --filter @objectstack/cli exec vitest run --project unit
--maxWorkers=2`: 277 files pass. Two files
(`published-subpath-console.pin`, `published-subpath-hook-body.pin`)
refused because `packages/cli/dist` was missing. After `pnpm --filter
@objectstack/cli build` they pass (2/2 files, 29/29 tests), so the layer
is 279/279 files.
- `pnpm --filter @objectstack/cli typecheck`: `tsc --noEmit` plus
`check:test-typecheck` OK. The file is in `tsconfig.test.json`'s program
(`tsc --listFilesOnly`).
- Gates: the derived set (`node scripts/pm/dispatch-gates.mjs
--commands`: 50 commands, identical to the dispatch's), plus
`check:authz-resolver`, `check:error-code-casing` and
`check:filter-alias-parity`. All exit 0. Two first answered a
prerequisite (exit 3) and passed once it was met:
`check-plugin-teardown-shape.mjs --self-test` (its pinned fixture commit
fetched into the shallow clone) and `check:dual-build-cjs-loads` (dists
present). `dispatch-gates --ran`: 50 derived, 50 run, 0 NOT-MEASURED, 0
UNRUN.
- `pnpm lint`, narrowed to the touched file, with the narrowing proven:
- eslint's own config puts the file in the population (`isPathIgnored`
false; `calculateConfigForFile` applies 5 rules);
- `eslint --no-inline-config --format json` on it counts 1 file, 0
errors, 0 warnings;
- no config object enables type-aware linting (`parserOptions` is only
`ecmaVersion`/`sourceType`), so the diff cannot move any untouched
file's verdict.
- Not merged with `main`, which is 5 commits ahead at `9f159397f`. None
of those commits touches this file, `dev.ts`,
`test/helpers/serve-process.ts`, `vitest.config.ts` or
`vitest-tiers.ts`. CI and the queue run the merge ref.
## Acceptance notes
- The `✗` line's naming of `false` is still asserted. It holds because
the catch-all echoes the command pnpm ran; the PACKAGE refusal itself is
pnpm's line.
- If the next CI red of this file names a signal or a spawn error under
load, that reading goes on #22618 (triage's direction). This PR does not
give the control a budget of its own.
---
_Generated by [Claude
Code](https://claude.ai/code/session_019SvPnd2bzECRNmAU9i6E4k)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 615cba8 commit eae3368
1 file changed
Lines changed: 47 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| 71 | + | |
64 | 72 | | |
65 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
66 | 82 | | |
67 | 83 | | |
68 | 84 | | |
| |||
74 | 90 | | |
75 | 91 | | |
76 | 92 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 93 | + | |
| 94 | + | |
84 | 95 | | |
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
94 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
95 | 123 | | |
96 | 124 | | |
97 | 125 | | |
| |||
154 | 182 | | |
155 | 183 | | |
156 | 184 | | |
157 | | - | |
| 185 | + | |
158 | 186 | | |
159 | 187 | | |
160 | | - | |
161 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
162 | 191 | | |
163 | 192 | | |
164 | 193 | | |
165 | 194 | | |
166 | 195 | | |
167 | | - | |
168 | | - | |
| 196 | + | |
| 197 | + | |
169 | 198 | | |
170 | 199 | | |
171 | 200 | | |
172 | | - | |
173 | | - | |
| 201 | + | |
| 202 | + | |
174 | 203 | | |
175 | 204 | | |
176 | 205 | | |
177 | | - | |
| 206 | + | |
178 | 207 | | |
179 | 208 | | |
0 commit comments