-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7903930: Support running individual parameterized tests and @Nested test classes #241
Conversation
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
@JornVernee This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
Implementation and associated tests look good on first sight! Will do some local experiments tomorrow. Please, also update related sections/phrases in the FAQ document, for example: |
I've updated the FAQ. See: 54d91bd |
…t classes" Revert TestNG related changes
Some results of offline discussion:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this feature, Jorn, with updates to the FAQ and tests.
Nit: please delete unused import statements and add a line to the CHANGELOG.md
file
src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java
Outdated
Show resolved
Hide resolved
src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java
Outdated
Show resolved
Hide resolved
? Pattern.compile("(?<dir>|[^A-Za-z?]|[^?]{2,}):(?<group>[A-Za-z0-9_,]+)") | ||
: Pattern.compile("(?<dir>[^?]*):(?<group>[A-Za-z0-9_,]+)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvement!
Co-authored-by: Christian Stein <[email protected]>
For array types, I believe that canonical names are also supported -- for example, |
Yes, that's a good point. I think the main user of this will be the intellij plugin, which will automatically derive the query string, but it wouldn't hurt to mention this in the FAQ. I'll try to see if there's a JUnit doc section that describes the supported format, and we could just link to that. |
I noticed that there's also a |
Binary names for classes and nested classes are fine. These two nested variants can be used for "lazy load" scenarios. See for example the API documentation of
|
I've updated the FAQ to link to the doc of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Jorn, these changes look reasonable to me.
Several of these files will need a copyright year update before integrating.
/integrate |
Going to push as commit b443973.
Your commit was automatically rebased without conflicts. |
@JornVernee Pushed as commit b443973. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
See the JBS issue for an extended problem description.
This PR adds support for running individual parameterized JUnit test methods, as well as nested test classes, by adding a new flavor of query string, prefixed with
junit-select
:This intends to take direct advantage of JUnits selector string support. The supported selectors are listed in the column on the right in the table here: https://junit.org/junit5/docs/current/user-guide/#running-tests-discovery-selectors
For example, running a method
foo
that takes no parameters could be done usingfoo
, just like before. Iffoo
has parameters, then for JUnit tests they have to be specified as a comma separated list of binary names. For that we can use themethod
selector. For example:This support is intended to be used by the intellij plugin to support running individual methods and nested classes (see #240).
Testing: I've added additional tests for the new cases. I've also been using a PoC of this feature as the basis for similar support in the intellij plugin that I'm working on.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jtreg.git pull/241/head:pull/241
$ git checkout pull/241
Update a local copy of the PR:
$ git checkout pull/241
$ git pull https://git.openjdk.org/jtreg.git pull/241/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 241
View PR using the GUI difftool:
$ git pr show -t 241
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/241.diff
Using Webrev
Link to Webrev Comment