[ https://issues.apache.org/jira/browse/SUREFIRE-1207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15055080#comment-15055080 ]
Tibor Digana commented on SUREFIRE-1207: ---------------------------------------- Everything starts with AbstractSurefireMojo.java. First of all you should talk with JUnit committers and find out how the inheritance of @Category works on inherited classes and interfaces, regarding classes and test methods. You can clone JUnit project and concentrate on their unit tests. I believe the inheritance is used there. This improvement should apply only if reuseForks=false and suiteXmlFiles is not set and JUnit != 3.x. I think you should see ForkStarter#getSuitesIterator(), SurefireProvider.getSuites() which employs filters. I guess we would need to have additional one. The filter must not use JUnit/TestNg filtering. We should do it all with Java Reflection API. > A new JVM is forked even for tests not matching the "groups" tag when > "reuseForks" is false > ------------------------------------------------------------------------------------------- > > Key: SUREFIRE-1207 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1207 > Project: Maven Surefire > Issue Type: Improvement > Affects Versions: 2.18.1 > Reporter: Michael Comerford > Fix For: Backlog > > > When the "groups" tag is used with "resuseForks" as false, a new fork is > created for every test, not just the one in the group tag. The tests which > don't match the group aren't ran, but a fork is still created and destroyed > for every test, which is very inefficient. > Example: > {code:xml} > <plugin> > <artifactId>maven-surefire-plugin</artifactId> > <configuration> > <skip>true</skip> > </configuration> > <executions> > <execution> > <id>default-tests</id> > <phase>test</phase> > <goals> > <goal>test</goal> > </goals> > <configuration> > <skip>false</skip> > <excludedGroups>IsolatedTests</excludedGroups> > </configuration> > </execution> > <execution> > <id>isolatedTests</id> > <phase>test</phase> > <goals> > <goal>test</goal> > </goals> > <configuration> > <skip>false</skip> > <groups>IsolatedTests</groups> > <forkCount>1</forkCount> > <reuseForks>false</reuseForks> > </configuration> > </execution> > </executions> > </plugin> > {code} > The forking can be seen when running maven in debug mode: {{mvn test -X}} and > searching for the text "Forking command line" -- This message was sent by Atlassian JIRA (v6.3.4#6332)