fix(cache): drop target/ outputs from test target (0.1.2)#7
Merged
Conversation
cargo test reuses the workspace target/ dir that build already populates, so per-crate test targets do not own that output. Snapshotting the full dir into .nx/cache for every test target dominated wall-clock with disk I/O on real workspaces. Test results remain cacheable by exit code. Bumps the package to 0.1.2. Fix ported from eddacraft/anvil.
Hardcoded 0.1.0 broke the e2e smoke as soon as the package bumped to 0.1.2. Read the version from the root package.json so the script tracks the package automatically.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces Nx cache I/O for Rust test targets by ensuring test targets don’t declare the workspace target/ directory as an output, while also bumping the package version and updating APS planning docs to reflect completion/progress.
Changes:
- Update
testTargetConfigto setoutputs: [](sotestis cached by result/terminal output without snapshottingtarget/). - Bump
@eddacraft/nxrustversion to0.1.2and add a corresponding changelog entry. - Mark APS plan/module status as Complete and record the risk mitigation resolution.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/target-configs.ts | Drops test outputs to avoid caching/restoring target/ for per-crate test tasks. |
| plans/modules/01-v0.1-shakedown.aps.md | Updates module status/checklists and records resolutions/dates. |
| plans/index.aps.md | Marks overall APS as Complete and annotates the resolved target/ caching risk for test. |
| package.json | Bumps package version to 0.1.2. |
| CHANGELOG.md | Adds an “0.1.2 — Unreleased” entry describing the caching change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
testTargetConfignow declaresoutputs: []instead of caching the workspacetarget/directory.cargo testreuses thetarget/populated bybuild, so per-crate test targets do not own that output; snapshotting the full dir into.nx/cachefor every test target dominates wall-clock with disk I/O on real workspaces. Test results remain cacheable by exit code.@eddacraft/nxrustto0.1.2.eddacraft/anvil.Resolves the
target/row of the risk table inplans/index.aps.mdfor thetesttarget (buildretainstarget/outputs deliberately — it is the producer).Test plan
pnpm typecheckcleanpnpm test— 44/44 passpnpm release:dry-run— tarball contains the expecteddist/**,executors.json,generators.json,LICENSE,README.md,CHANGELOG.md; no stray filespnpm install --frozen-lockfile && pnpm build && pnpm test && pnpm e2e) green on this branchpnpm publish --access public(prepublishOnly re-runs build + test + e2e)