Skip to content

Document what a nested test project does and does not do - #9

Open
davidanthoff wants to merge 1 commit into
mainfrom
docs/nested-test-projects
Open

Document what a nested test project does and does not do#9
davidanthoff wants to merge 1 commit into
mainfrom
docs/nested-test-projects

Conversation

@davidanthoff

Copy link
Copy Markdown
Member

Prompted by TestItemControllers.jl#97 and this discourse thread: a user put a Project.toml + Manifest.toml in test/special/, deved the package into it, added Aqua, and expected using Aqua in the test items under it to work. It fails with ArgumentError: 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 dependencies section 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

  • Step 2 rule 4 was wrong. "Since a package folder with its own manifest would already have been picked up in step 1, this means a package without a manifest" — step 1 searches ancestors of the file, not of the package, so a test/ folder holding both a project and a manifest reaches this path too, and the package folder's own manifest is then used.
  • envContentHash was 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 its test/Project.toml/test/Manifest.toml as well as the chosen project's pair, so editing test dependencies does restart a pooled process.
  • The generated test project also carries the package's own [deps], and resolves [targets] names through [weakdeps] as well as [extras].
  • The active environment was described as a test-project fallback without the condition that it must dev the package, in integrating/language-server.md, integrating/testitemruns.md and integrating/julia-apis.md.
  • pkg-test.md's setup step (Pkg.activate("test"); Pkg.add("TestItemRunner")) writes a test/Manifest.toml, which silently changes project selection for every item under test/ — now noted.

npm run docs:build passes; dead links are not ignored in the config, so the new anchors resolve.

🤖 Generated with Claude Code

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>
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.

1 participant