test: give every integration test its own bld dir on the cargo target drive#6022
Merged
baszalmstra merged 2 commits intoprefix-dev:mainfrom May 6, 2026
Merged
Conversation
57f9ae9 to
7f0036b
Compare
…d dir on the cargo target drive Two issues with the integration test setup: - The six tests that omitted with_workspace(...) on their CommandDispatcher fell back to <root>/bld for source_build_workspaces(), so every test in the binary wrote into one shared bld/ tree. - Every per-test tempdir was created via tempfile::tempdir(), which uses %TEMP%. On Windows that's typically C:\, while the project lives on a different drive. Once prefix-dev#6009 lands and the rattler cache root also lives in a tempdir, package-cache to prefix installs would be cross-drive copies instead of hardlinks. Fix both: - Add a test_tempdir() helper that creates tempdirs under CARGO_TARGET_TMPDIR with a short 'p-' prefix (Windows MAX_PATH). Route every tempfile::tempdir().unwrap() in the file through it so test scratch space sits on the cargo target drive. - Wire the six call sites without with_workspace(...) through test_tempdir() so each test gets its own bld/ (plus meta-v0/, artifacts-v0/, legacy-source-env/). default_cache_dirs() is left alone for prefix-dev#6009 to handle; once that lands, its OnceLock'd cache root will share the same drive as every test_tempdir().
7f0036b to
865e494
Compare
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.
Description
Two issues with the integration test setup in
pixi_command_dispatcher:with_workspace(...)on theirCommandDispatcherfell back to<root>/bldforsource_build_workspaces(), so every test in the binary wrote into one sharedbld/tree.tempfile::tempdir(), which uses%TEMP%. On Windows that's typicallyC:\, while the project lives on a different drive. Once test(pixi_command_dispatcher): isolate the integration cache to a per… #6009 lands and the rattler cache root also lives in a tempdir, package-cache to prefix installs would be cross-drive copies instead of hardlinks.Fix both:
test_tempdir()helper that creates tempdirs underCARGO_TARGET_TMPDIRwith a shortp-prefix (WindowsMAX_PATH). Route everytempfile::tempdir().unwrap()in the file through it so test scratch space sits on the cargo target drive.with_workspace(...)throughtest_tempdir()so each test gets its ownbld/(plusmeta-v0/,artifacts-v0/,legacy-source-env/).default_cache_dirs()is left alone for #6009 to handle; once that lands, itsOnceLock'd cache root will share the same drive as everytest_tempdir().Supersedes #6009
How Has This Been Tested?
cargo check --tests -p pixi_command_dispatcher --features slow_integration_testssucceeds locally andcargo fmt --checkis clean. The existing integration suite exercises every touched test.AI Disclosure
Tools: Claude
Checklist: