0

I am trying to run suite files in parallel (JunitTestOneSuite, JunitTestTwoSuite).

Code: https://bitbucket.org/connect2tech/connect2tech.in-apachemavenparallel

I am using the pom-in.connect2tech.parallel.suites.xml to run them in parallel using the following entry:

I tried setting parallel tag in pom file as suites, but it methods run in paralle.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${surefire.version}</version>
    <configuration>
        <parallel>suites</parallel>
        <threadCount>5</threadCount>
        <includes>
            <include>**/JunitTestTwoSuite.class</include>
            <include>**/JunitTestOneSuite.class</include>
        </includes>
    </configuration>
</plugin>

If i remove the following lines:

<parallel>suites</parallel>
<threadCount>5</threadCount>

It will run as methods, but I want to execute the suites in parallel. I am not able to execute the suites in parallel. Please help.

I want to be able to run the suites in different threads.

Naresh Chaurasia
  • 419
  • 5
  • 21
  • Please check if following solves your problem: https://stackoverflow.com/questions/45010589/how-to-run-parallel-suites-in-maven-and-testng and https://stackoverflow.com/questions/47777892/how-to-run-junit-suite-in-parallel-using-maven-surefire-plugin – Anshul Singhal Jul 12 '19 at 05:59
  • Following could also be useful link - https://www.baeldung.com/maven-junit-parallel-tests. On the other hand, why are you maintaining test suite in the sense that every time, new test class is introduced then it has to be added in one of suites. Instead, it is good to run test classes in parallel. – Anshul Singhal Jul 12 '19 at 06:01
  • It is also useful to go through version specific documentation of maven surefire as for example support for suites is available since surefire version 2.16 and Junit 4.7. – Anshul Singhal Jul 12 '19 at 06:12
  • @anshul I tried baeldung.com/maven-junit-parallel-tests link but no luck. The purpose of creating suites is that in once suite I want to have test files/classes which which will address regression, another suite will address smoke/sanity etc., one suite testing once functionality and another suite testing another functionality. I can do it with class level parallelism but creating suites will help me to put them together logically. – Naresh Chaurasia Jul 12 '19 at 10:32

0 Answers0