Activate a workspace test project directly - #103
Merged
davidanthoff merged 3 commits intoSep 12, 2026
Merged
Conversation
A package's test sub-project that is a Pkg workspace member is a complete, already resolved environment whose Manifest is the shared workspace Manifest, located by walking the workspace chain up from the folder. The scratch-env plus TestEnv path cannot serve it: it copies the project into a scratch directory, severing the workspace relationship, then finds no Manifest beside the copy and fails to resolve because the workspace's path-tracked packages are not registered. Activate such a project in place instead; activation is read-only, so it still never writes into the tree.
Member
|
I have some changes/additions coming, I'll push to this branch, ok? |
Narrow the in-place activation to exactly the shape `Pkg.test` (Julia 1.12+) runs in place: `<package>/test` that is a `[workspace]` member of the package project, checked through `Base.base_project` the way Pkg checks membership. The previous folder-name test also caught a `test/Project.toml` with a manifest of its own that `dev`s the package, which Pkg sandboxes — and on Julia before 1.12, where workspaces do not exist, that was the only thing it could catch. Do the two things Pkg's workspace branch does that activation alone skipped: `Pkg.instantiate` (fetching into the depot only — a workspace without a manifest is refused rather than resolved into the user's tree) and `Pkg.precompile`, so the caches are built inside the controller's serialized activation window rather than by every test process at its first `using`. Compare paths case-insensitively on Windows, where the two URIs of a request can disagree about the drive letter; handle trailing separators via `isdirpath`, since `normpath` keeps them. Tests: the membership helper on member/non-member layouts, an end-to-end run of a workspace test project with an unregistered path-tracked dependency that checks the tree is left untouched, and a non-member `test/` with its own manifest that must still land in a scratch copy. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
|
Thanks — the direction is right:
All of 🤖 Generated with Claude Code |
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.
A package's test sub-project that is a Pkg workspace member is a complete, already resolved environment whose Manifest is the shared workspace Manifest, located by walking the workspace chain up from the folder. The scratch-env plus TestEnv path cannot serve it: it copies the project into a scratch directory, severing the workspace relationship, then finds no Manifest beside the copy and fails to resolve because the workspace's path-tracked packages are not registered. Activate such a project in place instead; activation is read-only, so it still never writes into the tree.