Jilles van Gurp created SUREFIRE-1089:
-----------------------------------------
Summary: cannot disable junit execution with testng provider
Key: SUREFIRE-1089
URL: https://jira.codehaus.org/browse/SUREFIRE-1089
Project: Maven Surefire
Issue Type: Bug
Components: Maven Surefire Plugin, TestNG support
Affects Versions: 2.17, 2.16
Environment: java 8, osx, linux
Reporter: Jilles van Gurp
Priority: Minor
We have a project with mixed junit 3,4 and testng tests. To run these, we use
two surefire executions, one for testng and one for junit. This works fine in
surefire 2.15 but broke in 2.16 and some of our junit tests now execute twice:
once by the junit provider and a second time by the testng provider. I suspect
this may be related to SUREFIRE-1019, which I guess intended to make it
possible to run junit tests with the testng provider, except there appears to
be no way to disable the behavior. It only executes some of our junit tests and
not all of them so I still need the junit provider anyway.
I've tried disabling junit execution on the testng by attempting to set
junit=false or the corresponding system property testng.junit=false both of
which should disable this according to the testng documentation, except it
doesn't seem to work. I was not able to make another of their properties
(verbose) to produce any output either, so I suspect something is wrong with
the way surefire passes properties to testng.
Here's my plugin configuration with three not working ways of setting that
property:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/*Test.groovy</include>
<include>**/*TestSuite.java</include>
<include>**/*TestSuite.groovy</include>
</includes>
</configuration>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<testNGArtifactName>none:none</testNGArtifactName>
<junitArtifactName>junit:junit</junitArtifactName>
</configuration>
</execution>
<execution>
<id>testngonly</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<argLine>-Dtestng.junit=false</argLine>
<systemPropertyVariables>
<testng.junit>false</testng.junit>
</systemPropertyVariables>
<configuration>
<properties>
<property>
<name>junit</name>
<value>false</value>
</property>
<property>
<name>verbose</name>
<value>true</value>
</property>
</properties>
</configuration>
<junitArtifactName>none:none</junitArtifactName>
<testNGArtifactName>org.testng:testng</testNGArtifactName>
</configuration>
</execution>
</executions>
</plugin>
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)