Document what a nested test project does and does not do - #9
Open
davidanthoff wants to merge 1 commit into
Open
Conversation
A `Project.toml` + `Manifest.toml` pair inside a package that `dev`s the package
back is chosen as the project for the test items under it, which pins their
versions — but the test target is still read from the package, so a dependency
declared only in that nested project is not importable. Nothing on the site said
so, and following Step 2 rule 1 ("the innermost enclosing project of the test
file") naturally suggests the opposite.
Also corrected while checking the page against the implementation:
- Step 2 rule 4 claimed the fallback to the package folder implied a package
without a manifest. Step 1 searches the ancestors of the *file*, so a `test/`
folder holding a project and a manifest reaches it too, and the package
folder's own manifest is then used.
- The generated test project carries the package's own `[deps]` as well as the
`[targets]` names, and resolves those through `[weakdeps]` as well as
`[extras]`.
- `envContentHash` covers the package's own Project/Manifest and its
`test/Project.toml`/`test/Manifest.toml` too, not just the chosen project's
pair — so editing test dependencies does restart a pooled process. Four pages
said otherwise.
- The active environment was described as a test project fallback without the
condition that it must `dev` the package, in three places.
- The `Pkg.activate("test"); Pkg.add(...)` setup step writes a `test/Manifest.toml`,
which changes project selection for every item under `test/`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Prompted by TestItemControllers.jl#97 and this discourse thread: a user put a
Project.toml+Manifest.tomlintest/special/,deved the package into it, addedAqua, and expectedusing Aquain the test items under it to work. It fails withArgumentError: Package Aqua not found in current path.That is correct behaviour — the nested project supplies version pins, and Step 4 always reads the test target from the package — but nothing on the site said so. Following Step 2 rule 1 ("the innermost enclosing project of the test file") suggests the opposite, and only the Monorepo tip states the real rule, scoped to outer projects. New
### A nested project pins versions, it does not add dependenciessection under Step 4, a row in the short-answer table, and a troubleshooting entry for the error text.The nested-project pattern stays supported and is worth having: it is how different groups of test items get different pinned versions. (TestItemRuns.jl#13 fixes the half of that which was actually broken.)
Also corrected while checking the page against the implementation
test/folder holding both a project and a manifest reaches this path too, and the package folder's own manifest is then used.envContentHashwas understated in four places (environments.md,test-processes.md,integrating/jsonrpc.md,integrating/language-server.md). It folds in the package's own Project/Manifest and itstest/Project.toml/test/Manifest.tomlas well as the chosen project's pair, so editing test dependencies does restart a pooled process.[deps], and resolves[targets]names through[weakdeps]as well as[extras].devthe package, inintegrating/language-server.md,integrating/testitemruns.mdandintegrating/julia-apis.md.pkg-test.md's setup step (Pkg.activate("test"); Pkg.add("TestItemRunner")) writes atest/Manifest.toml, which silently changes project selection for every item undertest/— now noted.npm run docs:buildpasses; dead links are not ignored in the config, so the new anchors resolve.🤖 Generated with Claude Code