apache / apache/maven-surefire

[SUREFIRE-1752] Implement new value for the "parallel" config element (e.g. "categories")

Open
#3,099 5 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Stephan Bauer](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=stephan7777)** opened **[SUREFIRE-1752](https://issues.apache.org/jira/browse/SUREFIRE-1752?redirect=false)** and commented

According to http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html the "parallel" configuration element currently only supports the following values:
* suites
* suitesAndClasses
* suitesAndMethods
* classesAndMethods

We have a huge multi-module application with integrationtests living in many separate integrationtest-modules. Until now, all the integrationtests were executed through one additional central integrationtest-module, that contained the testsuite definitions. Each testsuites consists of tests from different integrationtest-modules.

Example:
* Testsuite A refers to tests from integrationtest-modules M1, M2 and M3
* Testsuite B refers to tests from integrationtest-modules M1, M3 and M4
* Testsuite C refers to tests from integrationtest-modules M2, M3 and M4

(all testsuites are disjoint, which means that each test belongs to exactly one testsuite)

Until now, the different testsuites were configured to be run in parallel, by using:

```java

org.apache.maven.plugins
maven-failsafe-plugin
3.0.0-M3

suites
5

```

The central integrationtest module occurs to be more or less a hack, because you need to duplicate all dependencies from all integrationtest modules. This results in the fact, that any integrationtest is not executed with the classpath of its own module but of the central module.

This turns out to be problematic sometimes (PS: furthermore we couldn't manage to configure the jacoco-maven-plugin properly so that the coverage of all the integrationtests could not measured correcty).

The idea to solve this is to replace the Testsuites with the Junit4 Categories. Unfortunately, the failsafe-plugin does not provide a value for the "parallel" config element based on the Junit categories. The consequence is, that all integrationtests now run serially which takes far too long and thus is not acceptable for us.

PS: Another alternative solution would be to upgrade to Junit5 and have parallelization based on the new "Tag" element. But obviously there is no such support available either.

PS-2: sorry for possibly using the wrong priority. Of course this is rather important for us, because it keeps us from moving away from the old central integrationtest module which is very annoying. I'm wondering that nobody else seems to have the same requirement as I can't imagine, that our usecase with testsuites spanning tests from different integrationtest modules is so exotic...

Best regards,

Stephan

---

**Affects:** 3.0.0-M4

Contributor guide

Open the contributing guide

Research direction

Start with the Maven Failsafe plugin's `parallel` configuration and its existing suite-parallelization behavior, then trace how JUnit 4 Categories are discovered and scheduled. Done means a categories-based parallel value is supported without the central integration-test module, with coverage for the new configuration and preserved behavior for existing values.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.