Repository navigation
test(version): stop the strategy unit tests running real cargo - #676
goosewobbler wants to merge 2 commits into
Conversation
versionStrategies.spec.ts mocks node:fs, so the Cargo.lock lookup in syncCargoLockfile finds a lock and the real sync shells out to `cargo update --workspace --offline` — 78 times per run. On a cold CI runner that pushes "should update all packages to the same version" past its 5s timeout; it failed that way on #668 and #671. Mock the sync like the other collaborators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HQN3v9Z4f1mu3xK4Z7K44e
|
Standing release PR: #614 · v0.42.0 queued (4 packages) · open 81d 23h 45m · ✅ ready to merge Release Preview — v0.41.2 → v0.41.3
These changes will be added to the release PR (#614) when merged: Changelogmonorepo 0.41.2 → 0.41.3
After merge — predicted release
Updated automatically by ReleaseKit |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HQN3v9Z4f1mu3xK4Z7K44e
|
Closing as superseded: the same one-line mock landed on Generated by Claude Code |
Description
packages/version/test/unit/core/versionStrategies.spec.tsmocksnode:fs, sofindCargoLockfile"finds" a Cargo.lock and the realsyncCargoLockfile(from #497) shells out tocargo update --workspace --offline— 78 times per run of the file. Locally that makes each sync-strategy test take ~150–190ms; on a cold CI runner it pushedcreateSyncStrategy > should update all packages to the same versionpast its 5s timeout:It failed that way on #668 (Node 24) and #671 (Node 22), neither of which touches this code; the other Node version passed each time.
The fix mocks
../../../src/cargo/cargoLock.jsalongside the spec's other collaborators. No test in the file asserts on the lock sync. (#674 moves the sync out of this code path entirely, which also removes the subprocess; this one-liner fixesmainnow and is harmless after #674.)Related Issue(s)
Unblocks #668 and #671.
Type of Change
feat— New featurefix— Bug fixdocs— Documentation changerefactor— Code refactoringtest— Adding or updating testschore— Maintenance, dependencies, toolingScope
@releasekit/version@releasekit/notes@releasekit/publish@releasekit/config@releasekit/coreChecklist
pnpm lint)pnpm test)pnpm typecheck)Testing Notes
child_processprobe preloaded, the spec spawnedcargo update --workspace --offline78 times before this change and 0 after. No other version unit spec spawns cargo.versionStrategies.spec.ts: 55 passed, tests 64ms total (was ~150ms per sync-strategy test).Generated by Claude Code


Confidence Score: 5/5
This PR appears safe to merge.Summary
Adds a
cargoLock.jsmock so strategy unit tests no longer launch Cargo.Reviews (1) · Last reviewed commit: "test(version): stop the strategy unit te..." · Reviewed by Greptile