Repository navigation
Make xtc test -c and -t select the test module's own classes - #755
Merged
Merged
Conversation
xtc test -c and -t found a class by asking the type system for its bare name first, and only then for that name under the test module. A test class whose name ecstasy also imports implicitly, such as Inner or Timer, therefore resolved to the Ecstasy class: -c Inner selected ecstasy's reflect.Outer.Inner, which has no tests, ran nothing and exited 0. -t Inner.works looked for works in that class and found nothing; a method selector that finds nothing added no selector, and a run with none falls back to every test of the module, so -t Inner.works ran the whole module, as did a misspelled -t such as Inner.nope or nope. A name the type system cannot parse, such as Sums<, threw an unhandled InvalidType instead of the "Invalid test class" error. The test module's own path now comes first, and the bare name second, both with hideExceptions=True. A method selector that matches no test is refused with "Invalid test method specified", as a class or package that is not there already was. Validation, on master f7d87b4, with the XDK built with and without this commit, and a module Mathy whose tests are adds, fails, Inner.works and Sums.small: xtc test without with -c Inner nothing runs, exit 0 Inner.works -t Inner.works all four run, exit 1 Inner.works -t Inner.nope all four run, exit 1 Invalid test method -t nope all four run, exit 1 Invalid test method -c Sums< InvalidType Invalid test class -c Mathy.Inner, -c Sums, -t Sums.small, -t adds and -c Nope do the same with and without it. A module Clocky with a class Timer shows the same for Timer: -c Timer runs nothing and exits 0, and -t Timer.ticks runs every test, without it; with it both run Timer.ticks alone. lib_json's 179 and lib_metrics' 4 xunit tests pass through testXtc. xunit_engine has no tests of its own to extend. Limits: -t Mathy.adds still roots its tree at the generated Mathy_xunit module, as before; it runs the right test.
lagergren
added a commit
that referenced
this pull request
Nov 4, 2026
thegridman
approved these changes
Nov 4, 2026
This was referenced Nov 4, 2026
lagergren
added a commit
that referenced
this pull request
Nov 4, 2026
lagergren
added a commit
that referenced
this pull request
Nov 4, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 5, 2026
lagergren
added a commit
that referenced
this pull request
Nov 5, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 9, 2026
lagergren
added a commit
that referenced
this pull request
Nov 9, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 11, 2026
lagergren
added a commit
that referenced
this pull request
Nov 11, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 22, 2026
lagergren
added a commit
that referenced
this pull request
Nov 22, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 27, 2026
lagergren
added a commit
that referenced
this pull request
Nov 27, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
lagergren
added a commit
that referenced
this pull request
Nov 28, 2026
lagergren
added a commit
that referenced
this pull request
Nov 28, 2026
Checked against git log, the local branches and GitHub on 2026-11-04: - Header: checked today; R6-R13 are all closed. - R13: the command-line and attach entries said the server passes agent=<jar> and its jar is the agent; both now say that held until the agent moved into javatools. The agent entry records the CI fixes of the rebase (fc302da, a145de1; #693 c4f916b, 0e95701). - LSP4IJ pull requests open: lists our three open ones, #1857 (UP67), #1854 (Ctrl+hover underline, LSP4IJ #1612, no UP entry) and #1858 (docs), with the other 96 merged. - The 0.30.0 bump branch: rebased on 2026-10-29 (tip 9cb776697c), so the base and tip given were stale; it needs rebasing onto today's errs, and its items keep their 2026-10-28 hashes, as said. - LSP4J: #1011 (closing #1010) and #1008 merged on 2026-11-03; #1009, #1016 and #1017 open. - "Not filed yet" was filed on 2026-10-28; the section says so, and UP17's #3728 is ticked: JetBrains pushed it to intellij-community master on 2026-11-03 (5079f25b88) and closed the pull request on 2026-11-04, unreleased. - Pull requests: #755 merged (a8d50aa) and the rebase dropped its copies; #693 last synchronized 2026-11-04 at c4f916b; the master candidates item is ticked, all decided by 2026-10-29, with #719's closing, #718's merge and #720's arrival on #693 said. Every relative link and anchor in the file resolves.
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.
Summary
xtc test -c <class>andxtc test -t <class>.<method>choose a subset of a module's xunit tests. On master they can silently choose the wrong one: either no tests at all or every test. They do it with a green exit when the run happens to pass. This PR makes both options find the test module's own classes and refuse a test name that matches nothing. It changes one file,lib_xunit_engine/.../DiscoveryConfiguration.x.What is wrong on master
findClass()turns a name likeInnerinto a class. It first asks the type system for the bare name, and only if that fails for the name under the test module (Mathy.Inner). The type system knows the roughly 170 names that Ecstasy imports implicitly. So when a test class shares one of those names (Inner,Outer,Timer,Random,Duration,Map,List,Path, …), the bare lookup succeeds and returns the Ecstasy class. Three things go wrong from there:-c Timerruns nothing and exits 0. It selectsecstasy.Timer, which has no tests. Someone running one class's tests, by hand or in CI, is told they passed when none ran.-t Timer.ticksruns every test in the module. It looks forticksinecstasy.Timer, finds nothing, and adds no selector. A run with no selectors falls back to the whole module.-talso runs every test.-t nopeand-t Inner.nopedo the same as case 2. A stale test name in a script widens the run instead of failing it, and if the other tests pass, the exit code is 0.A name the type system cannot parse at all, such as
Sums<, also throws an unhandledInvalidType. It should get the same "Invalid test class specified" error that a missing class already gets.What changes
findClass()tries the name under the test module first (Mathy.Inner), then the bare name. A class of the module now always wins over an implicit import of the same name. A name that starts with the module's name, such asMathy.Inner, still resolves through the bare lookup as before.hideExceptions=True. An unparsable name goes on to the next lookup, and then to the "Invalid test class" error.-tthat matches no test is refused withIllegalArgument: Invalid test method specified <name>. A missing class (-c) or package (-p) is already refused this way.The one behavior change anyone could notice is item 3: a
-tthat names no test now fails instead of running everything. That is the point of the change.Why now
We found this while building test runs into the IDEs, on the LSP branch (#693). There, the gutter icons and the test explorer run a single test or class through these selectors. A test class called
Innerran nothing, and running one of its tests ran the whole module.The bug and the fix are in xunit, not in the IDE code, and they don't depend on anything in #693. So the fix can go to master on its own now, and everyone who runs
xtc testwith-cor-tgets it. The same commit is on #693 and onlagergren/errs, with an identical patch. Once this merges, rebasing those branches drops it.Validation
This was tested on master f7d87b4, with the XDK built with and without this commit. The test module was
Mathy, whose tests areadds,fails(which fails on purpose),Inner.worksandSums.small:xtc test-c InnerInner.works-t Inner.worksInner.works-t Inner.nopeInvalid test method specified Inner.nope-t nopeInvalid test method specified nope-c Sums<InvalidTypeInvalid test class specified Sums<-c Mathy.Inner,-c Sums,-t Sums.small,-t adds-c NopeInvalid test class specified NopeA second module,
Clocky, has a classTimerwith a testticks. Without this PR,-c Timerruns nothing and exits 0, and-t Timer.ticksruns every test in the module and exits 0. With it, both runTimer.ticksalone.lib_json's 179 andlib_metrics' 4 xunit tests pass through./gradlew :xdk:lib-json:testXtc :xdk:lib-metrics:testXtc --rerun-tasks.xunit_engine has no tests of its own, so this PR adds none. On #693, the language server's
EmbeddedTestRunsTestruns one selected test through this path.To reproduce, write a module
Mathywith a nested classInnerthat has a testworks, then run:Known limit
-t Mathy.addsstill roots its test tree at the generatedMathy_xunitmodule, as it did before. It runs the right test.