You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Albert Pinto <pn...@yahoo.com.INVALID> on 2020/12/03 08:29:54 UTC

How to run each TestNG suite in a separate process?

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

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

Posted by Alexander Kriegisch <al...@kriegisch.name>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org