I've got the following suite.xml
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Smoke Suite">
<test name="Test">
<groups>
<run>
<include name="smoke" />
</run>
</groups>
<packages>
<package name="com.mine.*" />
</packages>
</test>
</suite>
I'd like to be able to set the parallel and thread-count attributes values from commandline so I can control these values at the time of kicking off the tests.
I've tried all fo the following. But with no success - there is always only one thread that TestNG is spinning up:
pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.13</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<webdriver.impl.class>${webdriver.impl.class}</webdriver.impl.class>
<parallel>${parallel}</parallel>
<threadCount>${threadCount}</threadCount>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng/testng-${suite}.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
Also tried this version of the pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.13</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<parallel>${parallel}</parallel>
<threadCount>${threadCount}</threadCount>
<systemPropertyVariables>
<webdriver.impl.class>${webdriver.impl.class}</webdriver.impl.class>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng/testng-${suite}.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
And passing in the values like so:
mvn clean integration-test -Dsuite=smoke -Dparallel=classes -DthreadCount=20
The suite variable is correctly getting substitute and TestNG is picking it up. But the parallel and threadCount properties are not being picked up in TestNG. My tests are still single-threaded.
Does anyone know what is the correct way to configure this. Or is this a bug in the failsafe/surefire plugin?