3

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?

Graham Russell
  • 997
  • 13
  • 24
  • 1
    New version 3.0.0-M6 was deployed to Maven Central which includes this fix as well. Pls let us know your feedback. Enjoy! – tibor17 Apr 04 '22 at 09:19

2 Answers2

4

We fixed this issue in Surefire 3.0.0-M6 but you have to wait to the release.

tibor17
  • 1,043
  • 6
  • 9
  • Ok, is there an ETA/roadmap somewhere for this? – Graham Russell Jul 02 '21 at 15:39
  • yes, there is road map, just google "maven surefire plugin". – tibor17 Jul 02 '21 at 20:02
  • Ah I see, but there are no dates there, it also seems that this issue has been moved to M7? https://maven.apache.org/surefire/maven-surefire-plugin/ – Graham Russell Jan 04 '22 at 12:03
  • Ah my mistake, it's on M7 on the roadmap but has already been fixed over a year ago. I presume it's this issue https://issues.apache.org/jira/browse/SUREFIRE-1535 Is a new release planned soon so people can make use of the fixes and features? – Graham Russell Jan 04 '22 at 12:09
  • We are finishing the development of M6. We found the issues in our CI systems and we have fixed a bunch of issue regarding stability of the plugins which could be seen by the users community. The roadmap is in progress and we want to cut M6 together with supported version of JDK18 till March. Meanwhile we have backported a plenty of fixed issues to 2.22.3 which will be released very soon with a support of JDK17. – tibor17 Feb 04 '22 at 01:42
  • M6 was released. – tibor17 Apr 14 '22 at 21:36
3

XmlSuite.setParallel(String) was @Deprecated in TestNG 7.3.0. It's gone in 7.4.0. I'd try switching back to:

    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>7.3.0</version>            
    </dependency>
Gerold Broser
  • 14,080
  • 5
  • 48
  • 107