How to run each TestNG suite in a separate process?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to run each TestNG suite in a separate process?

Albert Pinto
My pom.xml defines two TestNG suites as follows:
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19</version>
    <configuration combine.children="override">
      <forkCount>1</forkCount>
      <reuseForks>false</reuseForks>
      <suiteXmlFiles>
        <suiteXmlFile>suite-1.xml</suiteXmlFile>
        <suiteXmlFile>suite-2.xml</suiteXmlFile>
      </suiteXmlFiles>
    </configuration>
  </plugin>
</plugins>

I would like to run each suite in a separate jvm process one after another (without overlapping execution). I have tried playing around with different parameters but not able to get this working. Is there a way to do this?start process P1
run suite-1.xmlstop process P1start process P2run suite-2.xmlstop process P2
Reply | Threaded
Open this post in threaded view
|

Re: How to run each TestNG suite in a separate process?

Alexander Kriegisch-2
AFAIK 'reuseForks=false' starts each single test class in its own JVM. If that is not what you want, you should not use it like that. Instead, just define two test separate executions, each with one suite configured. For the module in question, you might then want to deactivate the default execution 'default-test' so as to avoid running all tests again in that one:

    <execution>
      <!-- We have two other, mutually exclusive text executions already and do not need this one -->
      <id>default-test</id>
      <phase>none</phase>
    </execution>

--
Alexander Kriegisch
https://scrum-master.de


Albert Pinto schrieb am 03.12.2020 15:29 (GMT +07:00):

> My pom.xml defines two TestNG suites as follows:
>   <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <version>2.19</version>
>     <configuration combine.children="override">
>       <forkCount>1</forkCount>
>       <reuseForks>false</reuseForks>
>       <suiteXmlFiles>
>         <suiteXmlFile>suite-1.xml</suiteXmlFile>
>         <suiteXmlFile>suite-2.xml</suiteXmlFile>
>       </suiteXmlFiles>
>     </configuration>
>   </plugin>
> </plugins>
>
> I would like to run each suite in a separate jvm process one after another
> (without overlapping execution). I have tried playing around with different
> parameters but not able to get this working. Is there a way to do this?start
> process P1
> run suite-1.xmlstop process P1start process P2run suite-2.xmlstop process P2
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]