Skip to content

test(version): stop the strategy unit tests running real cargo - #676

Closed
goosewobbler wants to merge 2 commits into
mainfrom
test/version-strategies-no-real-cargo
Closed

goosewobbler wants to merge 2 commits into
mainfrom
test/version-strategies-no-real-cargo

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Description

packages/version/test/unit/core/versionStrategies.spec.ts mocks node:fs, so findCargoLockfile "finds" a Cargo.lock and the real syncCargoLockfile (from #497) shells out to cargo 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 pushed createSyncStrategy > should update all packages to the same version past its 5s timeout:

FAIL test/unit/core/versionStrategies.spec.ts > Version Strategies > createSyncStrategy > should update all packages to the same version
Error: Test timed out in 5000ms.

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.js alongside 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 fixes main now and is harmless after #674.)

Related Issue(s)

Unblocks #668 and #671.

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation change
  • refactor — Code refactoring
  • test — Adding or updating tests
  • chore — Maintenance, dependencies, tooling
  • Breaking change — Requires major version bump

Scope

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/config
  • @releasekit/core
  • CI / workflows
  • Root / monorepo

Checklist

  • Lint passes (pnpm lint)
  • Tests pass (pnpm test)
  • Typecheck passes (pnpm typecheck)
  • Documentation updated (if applicable)
  • Breaking changes noted in description

Testing Notes

  • With a child_process probe preloaded, the spec spawned cargo update --workspace --offline 78 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).
  • Version unit suite with coverage (what CI runs): 33 files, 726 tests pass.

Generated by Claude Code

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Adds a cargoLock.js mock so strategy unit tests no longer launch Cargo.

  • Version strategy tests no longer start Cargo for lock syncing.

Reviews (1) · Last reviewed commit: "test(version): stop the strategy unit te..." · Reviewed by Greptile

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
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#614) when merged:

Changelog

monorepo 0.41.2 → 0.41.3

Changed

  • drop the comment on the cargoLock mock (version)
  • stop the strategy unit tests running real cargo (version)

All packages → 0.41.3 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.42.0 0.41.3 0.42.0

Updated automatically by ReleaseKit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQN3v9Z4f1mu3xK4Z7K44e

Copy link
Copy Markdown
Owner Author

Closing as superseded: the same one-line mock landed on main with #671, which carried it as a ported fix (907a72d / 18daebc). Merging this now would change nothing. #668 carries the identical commits, so it merges cleanly too.


Generated by Claude Code

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.

2 participants