Summary: | Introduce forkmode in JUnitLauncher task | ||
---|---|---|---|
Product: | Ant | Reporter: | Allan Francani <allan.francani> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 1.10.8 | ||
Target Milestone: | 1.10.14 | ||
Hardware: | PC | ||
OS: | Mac OS X 10.1 |
Description
Allan Francani
2021-03-09 11:11:42 UTC
Hello Allan, Could you tell us what the junitlauncher task usage looks like in your project? Are you using "testclasses" element within the junitlauncher and then a "fork" nested element in it? More specifically, are you requesting that each of the test classes identified within that "testclasses" element be launched in a forked vm of their own? Also, sorry about the late reply. I remember noticing this issue when it was initially filed but then forgot to reply and it's already 5 months now! (In reply to Jaikiran Pai from comment #1) > Hello Allan, > > Could you tell us what the junitlauncher task usage looks like in your > project? Are you using "testclasses" element within the junitlauncher and > then a "fork" nested element in it? More specifically, are you requesting > that each of the test classes identified within that "testclasses" element > be launched in a forked vm of their own? Hello, Yes, I would use the testclasses element to define the list of test classes to run and a fork element to define the forking strategy. What I am looking for is a mechanism that would be similar to the junit task forkmode="perTest" attribute: forking the JVM for each test class that is selected by the testclasses element. We have encountered similar issue. Is there any interest in implementing this? This has now been implemented. A new optional attribute "forkMode" can be provided to the <fork> element of <junitlauncher> task. That attribute allows "perTestClass" as a value and if that is what is specified then each of the test class is forked in a separate JVM of its own. Here's the documentation https://github.com/apache/ant/blob/master/manual/Tasks/junitlauncher.html#L643: <td>forkMode</td> <td>Controls how many JVMs are launched for the forked tests. Allowed values are: <ul class="inlinelist"> <li><code>perTestClass</code> - This mode launches each test class in a separately forked JVM</li> </ul> <p><em>Since Ant 1.10.14</em></p> </td> <td>No; defaults to launching all test classes in one single forked JVM.</td> This will be available in the upcoming 1.10.14 release. It will be helpful if one of you could try it out against our nightly Ant builds https://ci-builds.apache.org/job/Ant/job/Ant_Nightly/lastSuccessfulBuild/artifact/distribution/ |