Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: twenty in-process os doctor runs, one per posture, ledger fixture and flag, each shelling out to pnpm -v, tsc -v and git --version and bundling its own config, the first also paying the cold config-loader load; slowest CI reading 12.2 s (run 41255489006) of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* `os doctor` reports an unreadable installed-package ledger under EVERY
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: fifteen in-process os doctor runs, one per ledger fixture or flag (three of them on a module graph re-imported after vi.resetModules to swap the ledger reader), each shelling out to pnpm -v, tsc -v and git --version and bundling its own config, the first also paying the cold config-loader load; the fourteen row-builder cases are pure; slowest CI reading 12.3 s (run 41199450735) of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* `os doctor` does not print `✓ Unique scope` when it could not read the
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/doctor-node-env-default.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: fifteen in-process os doctor runs, one per NODE_ENV value, project shape and flag, each shelling out to pnpm -v, tsc -v and git --version and bundling its own config, the first also paying the cold config-loader load; the twenty-one row-builder cases are pure; slowest CI reading 11.4 s (run 41271604267) of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* `os doctor`'s unset-`NODE_ENV` row (#5673).
Expand Down
1 change: 1 addition & 0 deletions packages/cli/test/authoring-rule-command-parity.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: three spawns of the source CLI (os lint, os validate, os build) over one planted-defect stack, every one a distinct triple whose exit code is the contract; the nine rule cases run in process; slowest CI reading 12.5 s (run 41271604267) of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* The BEHAVIOURAL half of #4409, next to the structural ratchet in
Expand Down
12 changes: 9 additions & 3 deletions packages/cli/test/create-objectstack-stack-reach.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: one on-ramp scaffold child and three spawns of the source CLI (os g object, os g flow, os validate), chained over the one scaffolded project, every one a distinct triple; slowest CI reading 12.4 s (run 41255489006), taken through the tsx launcher this file no longer uses, of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* PIN (#20333) — `npm create objectstack` → `os g flow` → `os validate`
Expand Down Expand Up @@ -63,14 +64,19 @@ import { GENERATOR_SCAFFOLD_TARGETS } from '../src/commands/generate.js';
import { childEnv } from './helpers/serve-process.js';

const HERE = resolve(fileURLToPath(import.meta.url), '..');
/**
* Spawned by this process's own `node`, not through the `tsx` binary: the entry, its
* `src/` and its pinned `NODE_ENV=development` are the same either way, and the
* `.bin/tsx` launcher only adds a second node process in front of the CLI, about half
* of every spawn's wall (#23181).
*/
const CLI = resolve(HERE, '../bin/run-dev.js');
const TSX = resolve(HERE, '../../../node_modules/.bin/tsx');

// One `resolve(HERE, …)` call per line: `check:cross-package-test-inputs`
// reconstructs this read by SOURCE SCAN.
const ON_RAMP_BIN = resolve(HERE, '../../..', 'packages/create-objectstack/bin/create-objectstack.js');

/** One plain-node scaffold, then three oclif + tsx cold starts, sequential. */
/** One plain-node scaffold, then three oclif cold starts of the source CLI, sequential. */
const RUN_TIMEOUT_MS = 240_000;

const PROJECT = 'my-app';
Expand Down Expand Up @@ -106,7 +112,7 @@ function run(file: string, args: string[], cwd: string): Promise<Run> {
});
}

const os = (args: string[], cwd: string) => run(TSX, [CLI, ...args], cwd);
const os = (args: string[], cwd: string) => run(process.execPath, [CLI, ...args], cwd);
const out = (r: Run) => r.stdout + r.stderr;

const target = (type: string) => {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/test/hook-timeout-override-refusal.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: four vitest list children of this package (--hookTimeout, --teardownTimeout, no override, --testTimeout), every one a distinct config-load question; slowest CI reading 11.3 s (run 41255489006) of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* `--hookTimeout` must never return a GREEN from this package again (#18788).
Expand Down
12 changes: 9 additions & 3 deletions packages/cli/test/i18n-extract-companion-orphan.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
// test-budget: 20 — spawns the real producer once per single-cause fixture: four spawns of the source CLI (os i18n extract on the apps-only stack, its --check over a seeded legacy companion, and the full stack under --objects-only and --no-objects-only), every one a distinct triple; slowest CI reading 11.3 s (run 41271604267), taken through the tsx launcher this file no longer uses, of the five scheduled CI runs 41199450735, 41217827347, 41237094739, 41255489006, 41271604267, x 1.25, rounded up

/**
* The provenance companion accompanies the bundle modules beside it, and its
Expand Down Expand Up @@ -80,8 +81,13 @@ import { fileURLToPath } from 'node:url';
import { childEnv } from './helpers/serve-process.js';

const HERE = resolve(fileURLToPath(import.meta.url), '..');
/**
* Spawned by this process's own `node`, not through the `tsx` binary: the entry, its
* `src/` and its pinned `NODE_ENV=development` are the same either way, and the
* `.bin/tsx` launcher only adds a second node process in front of the CLI, about half
* of every spawn's wall (#23181).
*/
const CLI = resolve(HERE, '../bin/run-dev.js');
const TSX = resolve(HERE, '../../../node_modules/.bin/tsx');
const CLI_PACKAGE_ROOT = resolve(HERE, '..');

/** One object (2 leaves) + one app (1 leaf); the registry baseline rides along. */
Expand Down Expand Up @@ -146,7 +152,7 @@ function runExtract(
): { stdout: string; dir: string; files: string[] } {
const dir = join(outRoot, name);
const stdout = execFileSync(
TSX,
process.execPath,
[CLI, 'i18n', 'extract', config, '--locales=ja-JP', '--source-hashes', '--fill=default', ...flags, `--out=${dir}`],
{ encoding: 'utf8', env: childEnv(), timeout: 180_000 },
);
Expand Down Expand Up @@ -210,7 +216,7 @@ describe('os i18n extract — the provenance companion accompanies a module (#16

const stdout = plain(
execFileSync(
TSX,
process.execPath,
[
CLI, 'i18n', 'extract', APPS_ONLY, '--locales=ja-JP', '--source-hashes',
'--fill=default', '--no-metadata-forms', '--check', `--out=${dir}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* Integration tier: it spawns the source CLI (`packages/cli/vitest-tiers.ts`).
* Two spawns, one per fixture. The CLI runs through `bin/run-dev.js` (source,
* via tsx), and `@objectstack/spec` resolves through `exports` to `dist/`.
* spawned by this process's own `node`), and `@objectstack/spec` resolves through `exports` to `dist/`.
*/

import { afterAll, beforeAll, describe, expect, it } from 'vitest';
Expand All @@ -31,8 +31,13 @@ import { childEnv } from './helpers/serve-process.js';
import { writeDefineStackConfig } from './helpers/define-stack-fixture.js';

const HERE = resolve(fileURLToPath(import.meta.url), '..');
/**
* Spawned by this process's own `node`, not through the `tsx` binary: the entry, its
* `src/` and its pinned `NODE_ENV=development` are the same either way, and the
* `.bin/tsx` launcher only adds a second node process in front of the CLI, about half
* of every spawn's wall (#23181).
*/
const CLI = resolve(HERE, '../bin/run-dev.js');
const TSX = resolve(HERE, '../../../node_modules/.bin/tsx');

/** A service module contributing `nav_case` into an app another package owns. */
const stackOf = (navCase: Record<string, string>) => ({
Expand Down Expand Up @@ -77,7 +82,7 @@ interface Run {
function runCli(args: string[], cwd: string): Promise<Run> {
return new Promise((resolvePromise) => {
execFile(
TSX,
process.execPath,
[CLI, ...args],
{ cwd, maxBuffer: 16 * 1024 * 1024, env: childEnv({ NO_COLOR: '1' }) },
(err, stdout, stderr) => {
Expand Down
Loading