refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
// Drives the harness through its subprocess seam — the same seam CI uses —
|
||||
// rather than importing internals. Each test seeds a temporary directory
|
||||
// with mock `.test.cjs` files (each one a trivial node:test no-op) and
|
||||
// runs the harness against it via GSD_TEST_DIR.
|
||||
// runs the harness against it via MSD_TEST_DIR.
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -25,7 +25,7 @@ const { spawn } = require('node:child_process');
|
||||
const { runNode } = require('./helpers/process-seam.cjs');
|
||||
const { toLegacyResult } = require('./helpers/git-fixture.cjs');
|
||||
const { createTempDir, cleanup, CONFIG_LOCATION_ENV_KEYS } = require('./helpers.cjs');
|
||||
const { splitLines } = require('../gsd-core/bin/lib/text-lines.cjs');
|
||||
const { splitLines } = require('../msd-core/bin/lib/text-lines.cjs');
|
||||
|
||||
const HARNESS = path.join(__dirname, '..', 'scripts', 'run-tests.cjs');
|
||||
|
||||
@@ -54,7 +54,7 @@ function seed(dir, names) {
|
||||
function runHarness(testDir, args = [], extraEnv = {}) {
|
||||
// Clear node:test parent-context env so the harness's child `node --test`
|
||||
// doesn't refuse to run with "recursive run() skipping running files".
|
||||
const env = { ...process.env, GSD_TEST_DIR: testDir, ...extraEnv };
|
||||
const env = { ...process.env, MSD_TEST_DIR: testDir, ...extraEnv };
|
||||
delete env.NODE_TEST_CONTEXT;
|
||||
// #4070: strip RUN_TESTS_SHARD_RESERVE inherited from the OUTER job's own
|
||||
// environment. test.yml sets it on the "Run unit tests" step for the real
|
||||
@@ -89,7 +89,7 @@ describe('run-tests.cjs harness (issue #3597)', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempDir('gsd-3597-harness-');
|
||||
tmpDir = createTempDir('msd-3597-harness-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -247,9 +247,9 @@ describe('run-tests.cjs harness (issue #3597)', () => {
|
||||
assert.match(r.stderr, /0 test files selected/i);
|
||||
});
|
||||
|
||||
test('GSD_ALLOW_EMPTY_SUITE=1 downgrades empty suite to a warning and exits 0', () => {
|
||||
test('MSD_ALLOW_EMPTY_SUITE=1 downgrades empty suite to a warning and exits 0', () => {
|
||||
seed(tmpDir, ['a.test.cjs']);
|
||||
const r = runHarness(tmpDir, ['--suite', 'security'], { GSD_ALLOW_EMPTY_SUITE: '1' });
|
||||
const r = runHarness(tmpDir, ['--suite', 'security'], { MSD_ALLOW_EMPTY_SUITE: '1' });
|
||||
assert.strictEqual(r.status, 0);
|
||||
assert.match(r.stderr, /WARNING.*0 test files selected/i);
|
||||
});
|
||||
@@ -349,26 +349,26 @@ test('boom', () => { throw new Error('intentional'); });
|
||||
});
|
||||
|
||||
describe('env hermeticity', () => {
|
||||
// Regression guard for the two `delete process.env.GSD_PROJECT/GSD_WORKSTREAM`
|
||||
// Regression guard for the two `delete process.env.MSD_PROJECT/MSD_WORKSTREAM`
|
||||
// lines added in scripts/run-tests.cjs main() right after ensureBuiltArtifacts().
|
||||
// If those deletions are removed, the fixture's assertions fail inside the child
|
||||
// node:test process → non-zero harness exit → this test fails → CI catches it.
|
||||
test('harness strips GSD_PROJECT and GSD_WORKSTREAM before running child tests', () => {
|
||||
test('harness strips MSD_PROJECT and MSD_WORKSTREAM before running child tests', () => {
|
||||
// Write a fixture that asserts both vars are absent in the child process env.
|
||||
const FIXTURE = `'use strict';
|
||||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
test('ambient GSD workstream vars are stripped by the runner', () => {
|
||||
assert.strictEqual(process.env.GSD_PROJECT, undefined);
|
||||
assert.strictEqual(process.env.GSD_WORKSTREAM, undefined);
|
||||
test('ambient MSD workstream vars are stripped by the runner', () => {
|
||||
assert.strictEqual(process.env.MSD_PROJECT, undefined);
|
||||
assert.strictEqual(process.env.MSD_WORKSTREAM, undefined);
|
||||
});
|
||||
`;
|
||||
fs.writeFileSync(path.join(tmpDir, 'env-hermeticity.test.cjs'), FIXTURE, 'utf8');
|
||||
// Pass both vars in the ambient env given to the harness process.
|
||||
// The harness must delete them before spawning the child node:test process.
|
||||
const r = runHarness(tmpDir, [], {
|
||||
GSD_PROJECT: 'ambient-proj',
|
||||
GSD_WORKSTREAM: 'ambient-ws',
|
||||
MSD_PROJECT: 'ambient-proj',
|
||||
MSD_WORKSTREAM: 'ambient-ws',
|
||||
});
|
||||
assert.strictEqual(r.status, 0, r.stderr);
|
||||
});
|
||||
@@ -982,20 +982,20 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
|
||||
before(() => {
|
||||
// Single SUCCESS-path run, reused by T2/T3/T5 below.
|
||||
successDir = createTempDir('gsd-3889-success-');
|
||||
successDir = createTempDir('msd-3889-success-');
|
||||
seed(successDir, ['a.test.cjs']);
|
||||
eventsDirBefore = fs.readdirSync(require('os').tmpdir())
|
||||
.filter((n) => n.startsWith('gsd-run-tests-events-'));
|
||||
.filter((n) => n.startsWith('msd-run-tests-events-'));
|
||||
successRun = runHarness(successDir, []);
|
||||
eventsDirAfter = fs.readdirSync(require('os').tmpdir())
|
||||
.filter((n) => n.startsWith('gsd-run-tests-events-'));
|
||||
.filter((n) => n.startsWith('msd-run-tests-events-'));
|
||||
|
||||
// Single TIMEOUT-path run, reused by T1/T4 below. 2000ms is kept —
|
||||
// it is already the smallest value this suite used anywhere for the
|
||||
// per-chunk timeout, and going lower risks flaking on a loaded CI
|
||||
// box that has to boot node --test, register the hang, and observe
|
||||
// the kill inside the window.
|
||||
timeoutDir = createTempDir('gsd-3889-timeout-');
|
||||
timeoutDir = createTempDir('msd-3889-timeout-');
|
||||
fs.writeFileSync(path.join(timeoutDir, 'hangs.test.cjs'), HANGS_BODY, 'utf8');
|
||||
timeoutRun = runHarness(timeoutDir, [], {
|
||||
RUN_TESTS_NO_FORCE_EXIT: '1',
|
||||
@@ -1023,7 +1023,7 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
// T3: the ndjson companion reporter's destination file is a temp
|
||||
// artifact of the instrumentation, not a product output — it must not
|
||||
// survive a successful run. Assert against the OS temp root's own
|
||||
// "gsd-run-tests-events-*" prefix (scripts/run-tests.cjs's mkdtemp
|
||||
// "msd-run-tests-events-*" prefix (scripts/run-tests.cjs's mkdtemp
|
||||
// prefix) rather than any run-tests-owned directory, since that IS the
|
||||
// leak surface being guarded.
|
||||
test('the ndjson reporter temp dir is cleaned up after a successful run', () => {
|
||||
@@ -1031,7 +1031,7 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
assert.deepStrictEqual(
|
||||
eventsDirAfter,
|
||||
eventsDirBefore,
|
||||
`expected no leaked gsd-run-tests-events-* temp dir after a successful run; ` +
|
||||
`expected no leaked msd-run-tests-events-* temp dir after a successful run; ` +
|
||||
`before=${JSON.stringify(eventsDirBefore)} after=${JSON.stringify(eventsDirAfter)}`,
|
||||
);
|
||||
});
|
||||
@@ -1090,8 +1090,8 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
test('the reporter returns nully and appends only the handled event types as NDJSON', async () => {
|
||||
const reporter = require('../scripts/lib/ndjson-reporter.cjs');
|
||||
const eventsFile = path.join(tmpDir, 'ndjson-reporter-events.ndjson');
|
||||
const savedEventsFile = process.env.GSD_RUN_TESTS_EVENTS_FILE;
|
||||
process.env.GSD_RUN_TESTS_EVENTS_FILE = eventsFile;
|
||||
const savedEventsFile = process.env.MSD_RUN_TESTS_EVENTS_FILE;
|
||||
process.env.MSD_RUN_TESTS_EVENTS_FILE = eventsFile;
|
||||
try {
|
||||
async function* fakeEvents() {
|
||||
yield { type: 'test:start', data: { file: 'a.test.cjs', name: 't', nesting: 0, testNumber: 1 } };
|
||||
@@ -1116,9 +1116,9 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
assert.strictEqual(pass.file, 'a.test.cjs');
|
||||
} finally {
|
||||
if (savedEventsFile === undefined) {
|
||||
delete process.env.GSD_RUN_TESTS_EVENTS_FILE;
|
||||
delete process.env.MSD_RUN_TESTS_EVENTS_FILE;
|
||||
} else {
|
||||
process.env.GSD_RUN_TESTS_EVENTS_FILE = savedEventsFile;
|
||||
process.env.MSD_RUN_TESTS_EVENTS_FILE = savedEventsFile;
|
||||
}
|
||||
cleanup(eventsFile);
|
||||
}
|
||||
@@ -1135,8 +1135,8 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
test('the reporter records test:enqueue and test:dequeue for the hang shape (enqueue, dequeue, nothing else)', async () => {
|
||||
const reporter = require('../scripts/lib/ndjson-reporter.cjs');
|
||||
const eventsFile = path.join(tmpDir, 'ndjson-reporter-hang-shape.ndjson');
|
||||
const savedEventsFile = process.env.GSD_RUN_TESTS_EVENTS_FILE;
|
||||
process.env.GSD_RUN_TESTS_EVENTS_FILE = eventsFile;
|
||||
const savedEventsFile = process.env.MSD_RUN_TESTS_EVENTS_FILE;
|
||||
process.env.MSD_RUN_TESTS_EVENTS_FILE = eventsFile;
|
||||
try {
|
||||
async function* hangShapeEvents() {
|
||||
yield { type: 'test:enqueue', data: { file: 'hangs.test.cjs', name: 'hangs.test.cjs', nesting: 0 } };
|
||||
@@ -1160,9 +1160,9 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
assert.strictEqual(dequeue.file, 'hangs.test.cjs');
|
||||
} finally {
|
||||
if (savedEventsFile === undefined) {
|
||||
delete process.env.GSD_RUN_TESTS_EVENTS_FILE;
|
||||
delete process.env.MSD_RUN_TESTS_EVENTS_FILE;
|
||||
} else {
|
||||
process.env.GSD_RUN_TESTS_EVENTS_FILE = savedEventsFile;
|
||||
process.env.MSD_RUN_TESTS_EVENTS_FILE = savedEventsFile;
|
||||
}
|
||||
cleanup(eventsFile);
|
||||
}
|
||||
@@ -1177,8 +1177,8 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
test('the reporter writes only the init marker when the source yields zero events', async () => {
|
||||
const reporter = require('../scripts/lib/ndjson-reporter.cjs');
|
||||
const eventsFile = path.join(tmpDir, 'ndjson-reporter-init-only.ndjson');
|
||||
const savedEventsFile = process.env.GSD_RUN_TESTS_EVENTS_FILE;
|
||||
process.env.GSD_RUN_TESTS_EVENTS_FILE = eventsFile;
|
||||
const savedEventsFile = process.env.MSD_RUN_TESTS_EVENTS_FILE;
|
||||
process.env.MSD_RUN_TESTS_EVENTS_FILE = eventsFile;
|
||||
try {
|
||||
async function* emptyEvents() {}
|
||||
const result = await reporter(emptyEvents());
|
||||
@@ -1199,9 +1199,9 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
assert.strictEqual(typeof init.ts, 'number');
|
||||
} finally {
|
||||
if (savedEventsFile === undefined) {
|
||||
delete process.env.GSD_RUN_TESTS_EVENTS_FILE;
|
||||
delete process.env.MSD_RUN_TESTS_EVENTS_FILE;
|
||||
} else {
|
||||
process.env.GSD_RUN_TESTS_EVENTS_FILE = savedEventsFile;
|
||||
process.env.MSD_RUN_TESTS_EVENTS_FILE = savedEventsFile;
|
||||
}
|
||||
cleanup(eventsFile);
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ test('hangs forever', () => new Promise((resolve) => { setTimeout(resolve, ${HAN
|
||||
HANG_PARK_MS >= 4 * CHUNK_TIMEOUT_MS_FOR_HANG_RUN,
|
||||
`fixture park (${HANG_PARK_MS}ms) must exceed the chunk bound (${CHUNK_TIMEOUT_MS_FOR_HANG_RUN}ms) with margin`,
|
||||
);
|
||||
const dir = createTempDir('gsd-3889-hang-fixture-');
|
||||
const dir = createTempDir('msd-3889-hang-fixture-');
|
||||
t.after(() => cleanup(dir));
|
||||
const tf = path.join(dir, 'hangs.test.cjs');
|
||||
fs.writeFileSync(tf, HANGS_BODY, 'utf8');
|
||||
@@ -1833,7 +1833,7 @@ describe('parseShardReserve (#4070)', () => {
|
||||
* ensureBuiltArtifacts() regenerates it even when the sentinel is present.
|
||||
*
|
||||
* B. SIGNATURE B: misleading assertion failures from killed subprocesses
|
||||
* runGsdTools() previously had no timeout, so an OOM/SIGKILL'd subprocess
|
||||
* runMsdTools() previously had no timeout, so an OOM/SIGKILL'd subprocess
|
||||
* returned { success: false } and looked like a product error. This test
|
||||
* proves the kill-discrimination fix: a killed/timed-out invocation now
|
||||
* throws a labeled resource-starvation error, while a clean non-zero exit
|
||||
@@ -1875,10 +1875,10 @@ describe('bug #969 A — ensureBuiltArtifacts rebuilds stale artifacts', () => {
|
||||
* Returns { tmp, overrides, sentinelOut, targetOut, tsBuildInfoPath }.
|
||||
*
|
||||
* HERMETIC: all destructive tests use this helper. They NEVER touch the real
|
||||
* gsd-core/bin/lib/*.cjs or the real tsbuildinfo. (Regression from #996 fixed here.)
|
||||
* msd-core/bin/lib/*.cjs or the real tsbuildinfo. (Regression from #996 fixed here.)
|
||||
*/
|
||||
function makeTempProject() {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-bug969-'));
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-bug969-'));
|
||||
const srcDir = path.join(tmp, 'src');
|
||||
const outDir = path.join(tmp, 'out');
|
||||
const tsBuildInfoPath = path.join(outDir, '.tsbuildinfo');
|
||||
@@ -1928,7 +1928,7 @@ describe('bug #969 A — ensureBuiltArtifacts rebuilds stale artifacts', () => {
|
||||
* recreates all .cjs outputs including the deleted non-sentinel artifact.
|
||||
*
|
||||
* HERMETIC: this test operates on a self-contained temp project. It NEVER
|
||||
* touches gsd-core/bin/lib/core.cjs or the real tsbuildinfo. (Fixed from #996.)
|
||||
* touches msd-core/bin/lib/core.cjs or the real tsbuildinfo. (Fixed from #996.)
|
||||
*/
|
||||
test('rebuilds a non-sentinel artifact (with no tsbuildinfo) even when sentinel exists', () => {
|
||||
const { tmp, overrides, sentinelOut, targetOut, tsBuildInfoPath } = makeTempProject();
|
||||
@@ -1962,7 +1962,7 @@ describe('bug #969 A — ensureBuiltArtifacts rebuilds stale artifacts', () => {
|
||||
/**
|
||||
* PASS-AFTER: the unconditional build emits the expected output (sentinelmod.cjs).
|
||||
* Uses the temp project helper so this test is fully hermetic — it never touches
|
||||
* the real gsd-core/bin/lib tree.
|
||||
* the real msd-core/bin/lib tree.
|
||||
*/
|
||||
test('sentinel (semver-compare.cjs) still exists after unconditional build', () => {
|
||||
const { tmp, overrides, sentinelOut } = makeTempProject();
|
||||
@@ -1994,14 +1994,14 @@ describe('bug #969 A — ensureBuiltArtifacts rebuilds stale artifacts', () => {
|
||||
* (clean re-emit). The stale/missing output is always regenerated.
|
||||
*
|
||||
* HERMETIC: this test operates on a self-contained temp project. It NEVER
|
||||
* touches gsd-core/bin/lib/core.cjs or the real tsbuildinfo. (Fixed from #996.)
|
||||
* touches msd-core/bin/lib/core.cjs or the real tsbuildinfo. (Fixed from #996.)
|
||||
*/
|
||||
test('PERSISTENT-MIRROR: rebuilds stale output even when tsbuildinfo is present (non-incremental is authoritative)', () => {
|
||||
const { tmp, overrides, targetOut, tsBuildInfoPath } = makeTempProject();
|
||||
const STALE_TSBUILDINFO = JSON.stringify({
|
||||
program: { fileNames: [], options: { incremental: true } },
|
||||
version: '5.0.0',
|
||||
_gsd_test_marker: 'stale-persistent-mirror',
|
||||
_msd_test_marker: 'stale-persistent-mirror',
|
||||
});
|
||||
|
||||
try {
|
||||
@@ -2047,23 +2047,23 @@ describe('bug #969 A — ensureBuiltArtifacts rebuilds stale artifacts', () => {
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Part B — runGsdTools: timeout + kill-signal discrimination
|
||||
// Part B — runMsdTools: timeout + kill-signal discrimination
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
const TOOLS_PATH = path.join(__dirname, '..', 'gsd-core', 'bin', 'gsd-tools.cjs');
|
||||
describe('bug #969 B — runMsdTools kill-signal discrimination', () => {
|
||||
const TOOLS_PATH = path.join(__dirname, '..', 'msd-core', 'bin', 'msd-tools.cjs');
|
||||
|
||||
/**
|
||||
* Shared helper that mirrors the production runGsdTools implementation
|
||||
* Shared helper that mirrors the production runMsdTools implementation
|
||||
* (from tests/helpers.cjs) but accepts an explicit timeout so we can
|
||||
* trigger the kill path in tests without waiting 60 seconds.
|
||||
*
|
||||
* IMPORTANT: this helper is intentionally self-contained so that the test
|
||||
* proves the CONTRACT of the implementation, not just calls the real
|
||||
* runGsdTools (which would need a real 60s+ hang to trigger in tests).
|
||||
* runMsdTools (which would need a real 60s+ hang to trigger in tests).
|
||||
* We test the identical logic paths using a tiny timeout.
|
||||
*/
|
||||
function runGsdToolsWithTimeout(args, cwd, env, timeoutMs) {
|
||||
function runMsdToolsWithTimeout(args, cwd, env, timeoutMs) {
|
||||
// The session-identity subset stays a local literal on purpose: this helper
|
||||
// mirrors the production one to prove its CONTRACT, so it must not simply
|
||||
// re-import what it is testing. The config-LOCATION keys are the exception —
|
||||
@@ -2071,7 +2071,7 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
// hand-copied list of them is the #2665 drift this change exists to end. So
|
||||
// spread the canonical derived set (tests/helpers.cjs) and keep the rest local.
|
||||
const TEST_ENV_BASE = {
|
||||
GSD_SESSION_KEY: '',
|
||||
MSD_SESSION_KEY: '',
|
||||
CODEX_THREAD_ID: '',
|
||||
CLAUDE_SESSION_ID: '',
|
||||
...Object.fromEntries(CONFIG_LOCATION_ENV_KEYS.map((k) => [k, ''])),
|
||||
@@ -2095,8 +2095,8 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
// Production kill-discrimination logic (verbatim from helpers.cjs fix).
|
||||
if (err.killed || err.signal != null || err.code === 'ETIMEDOUT') {
|
||||
throw new Error(
|
||||
`[runGsdTools: resource-starvation / subprocess-kill] ` +
|
||||
`gsd-tools was killed before completion ` +
|
||||
`[runMsdTools: resource-starvation / subprocess-kill] ` +
|
||||
`msd-tools was killed before completion ` +
|
||||
`(signal=${err.signal}, code=${err.code}, killed=${err.killed}). ` +
|
||||
`This indicates host OOM or scheduler contention, not a product bug. ` +
|
||||
`stdout=${err.stdout?.toString().trim() || ''} ` +
|
||||
@@ -2119,7 +2119,7 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
* Without a timeout, an OOM-killed subprocess threw with err.killed=true
|
||||
* but the catch block fell through to `return { success: false, ... }`.
|
||||
* The test consumer saw a normal {success:false} result and tried to parse
|
||||
* gsd-tools output from it, causing a confusing downstream assertion fail.
|
||||
* msd-tools output from it, causing a confusing downstream assertion fail.
|
||||
*
|
||||
* PASS-AFTER (fix):
|
||||
* The kill-discrimination guard rethrows immediately with a labeled error
|
||||
@@ -2127,14 +2127,14 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
* asserts on that throw rather than getting a silent {success:false}.
|
||||
*
|
||||
* Mechanism: we use a tiny timeout (1ms) to guarantee a timeout-kill on a
|
||||
* real gsd-tools invocation (even `--help` takes >1ms to start node).
|
||||
* real msd-tools invocation (even `--help` takes >1ms to start node).
|
||||
*/
|
||||
test('throws a resource-starvation error when subprocess is killed/times out', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-969-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-969-'));
|
||||
try {
|
||||
// 1ms timeout guarantees ETIMEDOUT / killed before gsd-tools can respond.
|
||||
// 1ms timeout guarantees ETIMEDOUT / killed before msd-tools can respond.
|
||||
assert.throws(
|
||||
() => runGsdToolsWithTimeout(['--help'], tmpDir, {}, 1),
|
||||
() => runMsdToolsWithTimeout(['--help'], tmpDir, {}, 1),
|
||||
(err) => {
|
||||
assert.ok(
|
||||
err.message.includes('resource-starvation / subprocess-kill'),
|
||||
@@ -2153,10 +2153,10 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
* NOT throw — i.e., the timeout addition does not break the happy path.
|
||||
*/
|
||||
test('returns { success: true } for a normal fast command with generous timeout', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-969-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-969-'));
|
||||
try {
|
||||
// 30s timeout; gsd-tools --help completes in well under 1s.
|
||||
const result = runGsdToolsWithTimeout(['--help'], tmpDir, {}, 30000);
|
||||
// 30s timeout; msd-tools --help completes in well under 1s.
|
||||
const result = runMsdToolsWithTimeout(['--help'], tmpDir, {}, 30000);
|
||||
assert.ok(result.success === true, `Expected success:true, got ${JSON.stringify(result)}`);
|
||||
assert.ok(typeof result.output === 'string', 'output must be a string');
|
||||
} finally {
|
||||
@@ -2165,7 +2165,7 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
});
|
||||
|
||||
/**
|
||||
* Verify that a clean non-zero exit (a real gsd-tools application error, not
|
||||
* Verify that a clean non-zero exit (a real msd-tools application error, not
|
||||
* a kill) still returns { success: false } WITHOUT throwing. This preserves
|
||||
* existing test behavior that asserts on error shape.
|
||||
*
|
||||
@@ -2173,10 +2173,10 @@ describe('bug #969 B — runGsdTools kill-signal discrimination', () => {
|
||||
* cleanly (no project directory set up).
|
||||
*/
|
||||
test('returns { success: false } for a clean non-zero exit (no throw)', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-969-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-969-'));
|
||||
try {
|
||||
// 'phase list' on a directory with no .planning/ produces a clean error exit.
|
||||
const result = runGsdToolsWithTimeout(['phase', 'list'], tmpDir, {}, 30000);
|
||||
const result = runMsdToolsWithTimeout(['phase', 'list'], tmpDir, {}, 30000);
|
||||
assert.ok(result.success === false, `Expected success:false for clean error, got ${JSON.stringify(result)}`);
|
||||
assert.ok(result.exitCode !== 0, 'exitCode must be non-zero');
|
||||
// Must NOT have thrown — the clean-error path returns normally.
|
||||
@@ -2202,7 +2202,7 @@ describe('bug #969 C — ensureBuiltHooks populates hooks/dist before concurrent
|
||||
* is deterministic and root/OS-independent.
|
||||
*/
|
||||
function makeHooksFixture(hookNames) {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-969-hooks-'));
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-969-hooks-'));
|
||||
const distDir = path.join(tmp, 'hooks', 'dist');
|
||||
let buildCalls = 0;
|
||||
const runBuild = () => {
|
||||
@@ -2372,7 +2372,7 @@ describe('chunk packing weights measured cost (#2456)', () => {
|
||||
const ROOMY_CHARS = 100000;
|
||||
|
||||
function tableFrom(timings) {
|
||||
const tmp = createTempDir('gsd-2456-timings-');
|
||||
const tmp = createTempDir('msd-2456-timings-');
|
||||
const p = path.join(tmp, 'timings.json');
|
||||
fs.writeFileSync(p, JSON.stringify({ schema_version: 1, unit: 'ms', timings }), 'utf8');
|
||||
return { path: p, dir: tmp };
|
||||
@@ -2583,7 +2583,7 @@ describe('chunk packing weights measured cost (#2456)', () => {
|
||||
});
|
||||
|
||||
test('a corrupt timings file degrades to uniform weight, not an error', () => {
|
||||
const tmp = createTempDir('gsd-2456-corrupt-');
|
||||
const tmp = createTempDir('msd-2456-corrupt-');
|
||||
try {
|
||||
const p = path.join(tmp, 'timings.json');
|
||||
fs.writeFileSync(p, '{ this is not json', 'utf8');
|
||||
@@ -2866,7 +2866,7 @@ describe('chunk packing weights measured cost (#2456)', () => {
|
||||
// A v2 table could change the unit or key format; consuming it under v1
|
||||
// semantics would silently mis-weight every file. Falling back to null
|
||||
// (uniform weight) is the same graceful degradation as a missing table.
|
||||
const tmp = createTempDir('gsd-2456-schema-');
|
||||
const tmp = createTempDir('msd-2456-schema-');
|
||||
try {
|
||||
const p2 = path.join(tmp, 'timings.json');
|
||||
fs.writeFileSync(p2, JSON.stringify({ schema_version: 2, timings: { 'a.test.cjs': 100 } }), 'utf8');
|
||||
@@ -3134,7 +3134,7 @@ describe('packChunks unmeasured-file cap (red next @ccfed6335, @af822a80, 2026-0
|
||||
// ─── analyzeChunkEvents (#3889 durability fix) ──────────────────────────────
|
||||
//
|
||||
// scripts/lib/ndjson-reporter.cjs now writes durably (fs.appendFileSync to a
|
||||
// GSD_RUN_TESTS_EVENTS_FILE path) instead of yielding strings for Node to
|
||||
// MSD_RUN_TESTS_EVENTS_FILE path) instead of yielding strings for Node to
|
||||
// pipe through a buffered --test-reporter-destination WriteStream that a
|
||||
// SIGKILL can wipe out before it flushes. These tests exercise the READER
|
||||
// side (analyzeChunkEvents) directly against a hand-written events file, so
|
||||
@@ -3146,7 +3146,7 @@ describe('analyzeChunkEvents (#3889)', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempDir('gsd-3889-events-');
|
||||
tmpDir = createTempDir('msd-3889-events-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user