When upgrading from TestNG 4.6.0 to 4.7.0 I get the following error when trying to run the FailSafe goal.
mvn verify
...
[INFO] --- maven-failsafe-plugin:3.0.0-M5:integration-test (default) @ project ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[ERROR] 'void org.testng.xml.XmlSuite.setParallel(java.lang.String)'
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
The relevant parts of the pom.xml
look like:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.4.0</version>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<failIfNoTests>true</failIfNoTests>
<parallel>methods</parallel>
<threadCount>${threads}</threadCount>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
<groups>${groups}</groups>
<argLine>${jacocoArgLine}</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>3.0.0-M5</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
I presume this is related to a removal of the functionality in TestNG but so far I've only found this fix https://github.com/apache/maven-surefire/pull/339 that seems to indicate it's in 3.0.0-M6 which hasn't yet been released.
How might I fix this?
We fixed this issue in Surefire 3.0.0-M6 but you have to wait to the release.