Skip to content

Build the CLI npm distribution once for its test suite - #1182

Merged
taras merged 5 commits into
mainfrom
codex/reduce-npm-test-builds
Nov 8, 2026
Merged

taras merged 5 commits into
mainfrom
codex/reduce-npm-test-builds

Conversation

@taras

@taras taras commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

The CLI npm distribution suite builds the same package five times. Build it once in suite setup, retain it until all consumers and cleanup finish, and keep all five original cases independently reported.

Consumers keep their own working directories, processes and scoped middleware. Build-specific output middleware ends before cases run. All 70 original assertion sites and seven emitted CLI invocations remain.

Validation:

  • At 6e7c499a468afdbb4f519328cf83731db98ce222: one-file frozen Deno check, oxfmt and oxlint passed; three existing sort warnings remain.
  • The successful focused runtime run at prior commit 95f3fd43 covered all five original cases. Their suite and helpers remain byte-identical at the current head. The separate exploratory adapter-lifetime test and its unused support were removed at the user's direction; no runtime or timing run was repeated for that deletion.
  • Retained Planner acceptance and independent Codex gpt-6-astra delta review: PASS on 6e7c499a, no findings. The prior whole-change reviews remain applicable to the unchanged implementation.

One chronological local observation before removing the exploratory test: 216.997s before, 73.545s after (143.452s less). Cache, order and machine effects were not controlled; this is not a CI timing or whole-measurement completion guarantee. Independent fresh-build samples decrease from five to one; the cases do not compare build determinism.

Only scripts/tests/cli-npm-bin.test.ts changes. No corpus, runtime exclusion, runner, dependency, timeout or weight data changes. Main repair #1180, Preparation #1117 and measurement investigation #1179 remain separate. Required CI and the main-health gate still apply.

Closes #1181.

Delivery refresh: signed merge 5ab8c5d70cd9278e9cb03ccfef9fd162e7f9aee7 incorporates current main 23c9003, including the reviewed CI repairs and documentation update required by strict branch protection. Relative to main, only the original npm CLI test file differs; its reviewed blob remains 84bda304cd7eb04dd2b501039be87249ae0c6d99. The previous head's Deno Delivery shard failed once and then passed all 25 files on one unchanged-commit retry. Intermittence is recorded in open flake #1176; no causal repair is claimed. The final branch CI was still running when this PR merged and was superseded by post-merge verification. CI on main 0ef868f, including this cleanup, passed all required checks; its draft release also passed.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

PR #1182: Build the CLI npm distribution once for its test suite

1 files, +52 / -40

Scope

✅ PR scope looks good.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras
taras marked this pull request as ready for review November 8, 2026 12:56
taras and others added 3 commits November 8, 2026 08:03
The closure-publishability case and the <Plan> identity case each built
the CLI package into their own private workspace. The manifest checks now
run immediately after the Plan case's build, before its emitted-bin
consumers, so the file builds four times instead of five. Every assertion
and child command is retained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every case in cli-npm-bin.test.ts built packages/cli into a private
workspace of its own, five builds of the same inputs. A beforeAll now
acquires one workspace and builds it once; each case reads that finished
package and keeps its consumer directories, child processes and Api
middleware to itself. The five original cases and their assertions are
restored. The two smoke runs and the upgrade refusal run from a
case-owned directory instead of the shared package root, and planned.txt
is checked where the smoke run would write it.

A same-file regression drives the test adapter directly. It proves that
a one-time resource outlives each case, that a failed case leaves it to
the next, and that it is released only after the last case's cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The adapter lifetime test in cli-npm-bin.test.ts was written to confirm
how a beforeAll resource outlives its cases. It is not coverage this suite
needs to carry. It is removed together with the imports and helper only it
used. The one-build npm CLI package suite is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@taras
taras merged commit 2649c49 into main Nov 8, 2026
31 of 63 checks passed
@taras
taras deleted the codex/reduce-npm-test-builds branch November 8, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build the CLI npm artifact once for distribution tests

1 participant