Skip to content

Commit 688236e

Browse files
mattrpavjeanouii
authored andcommitted
[AMQ-8525] Add parallel-tests profile to isolate surefire plugin configuration for parallel test runs
1 parent 6153ebc commit 688236e

File tree

2 files changed

+117
-59
lines changed

2 files changed

+117
-59
lines changed

activemq-mqtt/pom.xml

Lines changed: 75 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -202,56 +202,21 @@
202202
<plugin>
203203
<artifactId>maven-surefire-plugin</artifactId>
204204
<configuration>
205+
<forkCount>1</forkCount>
206+
<reuseForks>false</reuseForks>
205207
<argLine>${surefire.argLine}</argLine>
206208
<runOrder>alphabetical</runOrder>
207-
<reportFormat>plain</reportFormat>
208-
<excludedGroups>org.apache.activemq.transport.mqtt.ParallelTest</excludedGroups>
209-
<systemPropertyVariables>
210-
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
211-
<org.apache.activemq.AutoFailTestSupport.disableSystemExit>true</org.apache.activemq.AutoFailTestSupport.disableSystemExit>
212-
<org.apache.activemq.broker.jmx.createConnector>false</org.apache.activemq.broker.jmx.createConnector>
213-
<org.apache.activemq.default.directory.prefix>${project.build.directory}/</org.apache.activemq.default.directory.prefix>
214-
</systemPropertyVariables>
215-
<consoleOutputReporter>
216-
<disable>true</disable>
217-
</consoleOutputReporter>
218-
<statelessTestsetInfoReporter
219-
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
220-
<printStacktraceOnError>true</printStacktraceOnError>
221-
<printStacktraceOnFailure>true</printStacktraceOnFailure>
222-
<printStdoutOnError>true</printStdoutOnError>
223-
<printStdoutOnFailure>true</printStdoutOnFailure>
224-
<printStderrOnError>true</printStderrOnError>
225-
<printStderrOnFailure>true</printStderrOnFailure>
226-
</statelessTestsetInfoReporter>
227-
<excludes>
228-
<exclude>**/PahoMQTNioTTest.java</exclude>
229-
</excludes>
209+
<systemPropertyValues>
210+
<org.apache.activemq.default.directory.prefix>target</org.apache.activemq.default.directory.prefix>
211+
</systemPropertyValues>
212+
<!-- includes>
213+
<include>**/*Test.*</include>
214+
</includes -->
215+
<excludes>
216+
<exclude>**/PahoMQTNioTTest.java</exclude>
217+
</excludes>
230218
</configuration>
231-
<executions>
232-
<execution>
233-
<id>parallel</id>
234-
<phase>test</phase>
235-
<goals>
236-
<goal>test</goal>
237-
</goals>
238-
<configuration>
239-
<!-- drop the default excludedGroups -->
240-
<excludedGroups combine.self="override"/>
241-
<groups>org.apache.activemq.transport.mqtt.ParallelTest</groups>
242-
<forkCount>2C</forkCount>
243-
<reuseForks>false</reuseForks>
244-
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
245-
<systemPropertyVariables>
246-
<org.apache.activemq.default.directory.prefix>${project.build.directory}/parallel-tests-${surefire.forkNumber}/</org.apache.activemq.default.directory.prefix>
247-
<!-- when running MQTT tests in parallel in the CI (quite slow) we need to bump the wireformat negotiation timeout (5s by default) -->
248-
<org.apache.activemq.transport.wireFormatNegotiationTimeout>20000</org.apache.activemq.transport.wireFormatNegotiationTimeout>
249-
</systemPropertyVariables>
250-
</configuration>
251-
</execution>
252-
</executions>
253219
</plugin>
254-
255220
<plugin>
256221
<groupId>org.apache.activemq.protobuf</groupId>
257222
<artifactId>activemq-protobuf</artifactId>
@@ -329,6 +294,70 @@
329294
</plugins>
330295
</build>
331296
</profile>
297+
<profile>
298+
<id>parallel-tests</id>
299+
<activation>
300+
<property>
301+
<name>parallel-tests</name>
302+
</property>
303+
</activation>
304+
<build>
305+
<plugins>
306+
<plugin>
307+
<artifactId>maven-surefire-plugin</artifactId>
308+
<configuration>
309+
<argLine>${surefire.argLine}</argLine>
310+
<runOrder>alphabetical</runOrder>
311+
<reportFormat>plain</reportFormat>
312+
<excludedGroups>org.apache.activemq.transport.mqtt.ParallelTest</excludedGroups>
313+
<systemPropertyVariables>
314+
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
315+
<org.apache.activemq.AutoFailTestSupport.disableSystemExit>true</org.apache.activemq.AutoFailTestSupport.disableSystemExit>
316+
<org.apache.activemq.broker.jmx.createConnector>false</org.apache.activemq.broker.jmx.createConnector>
317+
<org.apache.activemq.default.directory.prefix>${project.build.directory}/</org.apache.activemq.default.directory.prefix>
318+
</systemPropertyVariables>
319+
<consoleOutputReporter>
320+
<disable>true</disable>
321+
</consoleOutputReporter>
322+
<statelessTestsetInfoReporter
323+
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
324+
<printStacktraceOnError>true</printStacktraceOnError>
325+
<printStacktraceOnFailure>true</printStacktraceOnFailure>
326+
<printStdoutOnError>true</printStdoutOnError>
327+
<printStdoutOnFailure>true</printStdoutOnFailure>
328+
<printStderrOnError>true</printStderrOnError>
329+
<printStderrOnFailure>true</printStderrOnFailure>
330+
</statelessTestsetInfoReporter>
331+
<excludes>
332+
<exclude>**/PahoMQTNioTTest.java</exclude>
333+
</excludes>
334+
</configuration>
335+
<executions>
336+
<execution>
337+
<id>parallel</id>
338+
<phase>test</phase>
339+
<goals>
340+
<goal>test</goal>
341+
</goals>
342+
<configuration>
343+
<!-- drop the default excludedGroups -->
344+
<excludedGroups combine.self="override"/>
345+
<groups>org.apache.activemq.transport.mqtt.ParallelTest</groups>
346+
<forkCount>2C</forkCount>
347+
<reuseForks>false</reuseForks>
348+
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
349+
<systemPropertyVariables>
350+
<org.apache.activemq.default.directory.prefix>${project.build.directory}/parallel-tests-${surefire.forkNumber}/</org.apache.activemq.default.directory.prefix>
351+
<!-- when running MQTT tests in parallel in the CI (quite slow) we need to bump the wireformat negotiation timeout (5s by default) -->
352+
<org.apache.activemq.transport.wireFormatNegotiationTimeout>20000</org.apache.activemq.transport.wireFormatNegotiationTimeout>
353+
</systemPropertyVariables>
354+
</configuration>
355+
</execution>
356+
</executions>
357+
</plugin>
358+
</plugins>
359+
</build>
360+
</profile>
332361
</profiles>
333362

334363
<repositories>

pom.xml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
<maven-project-info-reports-plugin-version>3.9.0</maven-project-info-reports-plugin-version>
128128
<maven-graph-plugin-version>1.45</maven-graph-plugin-version>
129129
<maven-core-version>3.8.6</maven-core-version>
130+
<maven-surefire-plugin-version>3.5.3</maven-surefire-plugin-version>
131+
<maven-surefire-junit5-tree-reporter-version>1.5.1</maven-surefire-junit5-tree-reporter-version>
130132
<!-- OSGi bundles properties -->
131133
<activemq.osgi.import.pkg>*</activemq.osgi.import.pkg>
132134
<activemq.osgi.export.pkg>org.apache.activemq*</activemq.osgi.export.pkg>
@@ -964,7 +966,7 @@
964966
<plugin>
965967
<groupId>org.apache.maven.plugins</groupId>
966968
<artifactId>maven-surefire-plugin</artifactId>
967-
<version>3.5.3</version>
969+
<version>${maven-surefire-plugin-version}</version>
968970
<configuration>
969971
<redirectTestOutputToFile>true</redirectTestOutputToFile>
970972
<forkCount>1</forkCount>
@@ -977,18 +979,6 @@
977979
</systemPropertyVariables>
978980
<argLine>-Xmx512m</argLine>
979981
</configuration>
980-
<dependencies>
981-
<dependency>
982-
<groupId>org.apache.maven.surefire</groupId>
983-
<artifactId>surefire-junit47</artifactId>
984-
<version>${surefire.version}</version>
985-
</dependency>
986-
<dependency>
987-
<groupId>me.fabriciorby</groupId>
988-
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
989-
<version>1.5.1</version>
990-
</dependency>
991-
</dependencies>
992982
</plugin>
993983
<plugin>
994984
<groupId>org.apache.felix</groupId>
@@ -1344,6 +1334,45 @@
13441334
</plugins>
13451335
</build>
13461336
</profile>
1337+
<profile>
1338+
<id>parallel-tests</id>
1339+
<activation>
1340+
<property>
1341+
<name>parallel-tests</name>
1342+
</property>
1343+
</activation>
1344+
<build>
1345+
<plugins>
1346+
<plugin>
1347+
<artifactId>maven-surefire-plugin</artifactId>
1348+
<configuration>
1349+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
1350+
<forkCount>1</forkCount>
1351+
<reuseForks>true</reuseForks>
1352+
<argLine>-enableassertions</argLine>
1353+
<failIfNoTests>false</failIfNoTests>
1354+
<systemPropertyVariables>
1355+
<java.awt.headless>true</java.awt.headless>
1356+
<org.apache.activemq.kahaDB.files.skipMetadataUpdate>true</org.apache.activemq.kahaDB.files.skipMetadataUpdate>
1357+
</systemPropertyVariables>
1358+
<argLine>-Xmx512m</argLine>
1359+
</configuration>
1360+
<dependencies>
1361+
<dependency>
1362+
<groupId>org.apache.maven.surefire</groupId>
1363+
<artifactId>surefire-junit47</artifactId>
1364+
<version>${surefire.version}</version>
1365+
</dependency>
1366+
<dependency>
1367+
<groupId>me.fabriciorby</groupId>
1368+
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
1369+
<version>${maven-surefire-junit5-tree-reporter-version}</version>
1370+
</dependency>
1371+
</dependencies>
1372+
</plugin>
1373+
</plugins>
1374+
</build>
1375+
</profile>
13471376
<profile>
13481377
<id>apache-release</id>
13491378
<activation>

0 commit comments

Comments
 (0)