Aditya Gupta
Aditya Gupta

Reputation: 21

Maven-surefire plugin excluding parallel test

i am using maven-surefire, cucumber and testng to run a few cucumber test in parallel, I would like to execute a few test in parallel and a few in serial order. PS- i am not using testng.xml but using testrunner.java to run my test.

Regards

Upvotes: 2

Views: 2199

Answers (2)

tibor17
tibor17

Reputation: 1123

Please see the annotation @NotThreadSafe and the documentation https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html There is exactly this problem solved. It goes with JUnit 4 - not TestNG and JUnit5.

Upvotes: 1

Amerousful
Amerousful

Reputation: 2545

You can set-up parallel in your pom.xml. Need add configuration with thread count and parallel (methods, class, etc.)

Example:

</plugins>
    [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <parallel>methods</parallel>
          <threadCount>10</threadCount>
        </configuration>
      </plugin>
    [...]
</plugins>

Upvotes: 1

Related Questions