HDFS-14888. RBF: Enable Parallel Test Profile for builds. Contributed by Ayush Saxena.

This commit is contained in:
Ayush Saxena 2019-10-03 19:21:27 +05:30
parent c19fa3d4fe
commit 5a7483ca5c
1 changed files with 48 additions and 0 deletions

View File

@ -236,4 +236,52 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>parallel-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
<executions>
<execution>
<id>parallel-tests-createdir</id>
<goals>
<goal>parallel-tests-createdir</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>${testsThreadCount}</forkCount>
<reuseForks>false</reuseForks>
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
<systemPropertyVariables>
<testsThreadCount>${testsThreadCount}</testsThreadCount>
<test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
<test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
<hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
<!-- This is intentionally the same directory for all JUnit -->
<!-- forks, for use in the very rare situation that -->
<!-- concurrent tests need to coordinate, such as using lock -->
<!-- files. -->
<test.build.shared.data>${test.build.data}</test.build.shared.data>
<!-- Due to a Maven quirk, setting this to just -->
<!-- surefire.forkNumber won't do the parameter substitution. -->
<!-- Putting a prefix in front of it like "fork-" makes it -->
<!-- work. -->
<test.unique.fork.id>fork-${surefire.forkNumber}</test.unique.fork.id>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>