Repository navigation
Add --packages / --exclude-packages to the test command - #10
Merged
Merged
Conversation
Discovery is a folder walk, not a package dependency traversal, so `test` at the root of a monorepo or a Pkg `[workspace]` already covers every package below it, each in its own test environment. What was missing was the other direction: narrowing a run to the member being worked on, without paying to activate and precompile the rest. The `test` command had `--name` and `--tags` but no package filter at all, even though the predicate `_build_run_kwargs` builds is already handed a `package_name`. `_package_filter` turns the two new values into that predicate and into the description the "Selected N of M after filtering ..." line prints; `test list` uses the same helper so listing and running agree. Names match exactly and case sensitively, as Julia package names are, include is applied before exclude, and an item that belongs to no package is never selected by `--packages`. 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.
Opened by Claude (Claude Code), at David's request. Companion to julia-testitems/TestItemApp.jl#25, which adds the same two flags to
juliati; the two are independent and can merge in either order.Why
A question on Slack asked how to run the tests of every sub-project of a Pkg
[workspace]from the root — "it'd be cool if there was a] test --recursive". In this framework that problem does not exist: discovery is a folder walk, not a package dependency traversal, sotestat a monorepo or workspace root already runs every package below it, each in its own test environment.What was missing is the other direction — narrowing a run to the member you are working on, without paying to activate and precompile the rest.
testhad--nameand--tagsbut no package filter at all.What
_package_filterturns the two values into the predicate_build_run_kwargsalready builds (which is handed apackage_nameas it is) and into the description theSelected N of M after filtering ...line prints.test listuses the same helper, so listing and running agree about what--packagesmeans. Names match exactly and case sensitively, include is applied before exclude, and an item belonging to no package is never selected by--packages. Help text, README and tab completion updated.A typo needs no special handling: the existing
No test item matched the filter on packages Foo. Use 'test list' to see what is there.covers it.Testing
57/57test items pass. New coverage:_package_filterfor include/exclude/both, case sensitivity, the no-package case and empty-name rejection;_build_run_kwargscomposing the selection with--nameand naming both in the description; a realtest run --packages=through the REPL parser, including the no-match message;test list --packages=; and the flag-completion lists (test run --and, newly asserted,test list --).🤖 Generated with Claude Code