Problem
tests/build-mds.test.ts runs 18 spawnSync full MDS build invocations in separate describe blocks, one per command file being tested. This causes suite-runtime sensitivity: total test time swings from 15s (quiet machine) to 10min+ (load).
Current structure:
- 18 describe() blocks
- Each describe() invokes full
npm run build:mds via spawnSync
- Sequential execution × 18 = 18× build time in test suite alone
Context
- Pre-existing pattern identified as suite-runtime sensitivity blocker
- Related to suite timing variability (noted in memory context)
- Opportunities to consolidate MDS build setup
Solution
- Hoist MDS build to module scope — run single
npm run build:mds before all tests
- Cache build output — all 18 describe blocks read from cache, zero rebuild
- Verify incremental — add a smoke test to detect stale cache (rebuild on source change)
- Measure — compare suite time: 18× individual builds vs 1× shared + 18× cache reads
Acceptance Criteria
Related
Problem
tests/build-mds.test.tsruns 18spawnSyncfull MDS build invocations in separatedescribeblocks, one per command file being tested. This causes suite-runtime sensitivity: total test time swings from 15s (quiet machine) to 10min+ (load).Current structure:
npm run build:mdsvia spawnSyncContext
Solution
npm run build:mdsbefore all testsAcceptance Criteria
Related