apache / apache/maven-surefire

[SUREFIRE-2088] Split test into chunks and select chunk to run

Open
#2,770 0 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

**[Liam Sharp](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=liam.sharp)** opened **[SUREFIRE-2088](https://issues.apache.org/jira/browse/SUREFIRE-2088?redirect=false)** and commented

A lot of CI environments (GitHub Actions/Circle CI etc) charge by the minute. So running tests across multiple boxes costs very little more than 1 box, but gives results back much quicker. 

I've love to be able to do some thing like:

mvn tests -Dsurefire.chunks=10 -Dsurefire.chunk=1

Which I could run on box 1 of 10, then 

mvn tests -Dsurefire.chunks=10 -Dsurefire.chunk=2

on box 2, etc etc.

I've seen solutions that involved code outside of maven looking at JUnit test results and producing a files to pass in -Dsurefire.excludesFile on each of the boxes. This solution requires state from previous runs and code outside of surefire. I think being able to do this completely in the surefire plugin would be a great enhancement. User could provide the chunks/chunk values, and then optionally (as a plus plus feature) some test results that give timings to allow more even test distribution across the chunks.

 

 

 

---
No further details from [SUREFIRE-2088](https://issues.apache.org/jira/browse/SUREFIRE-2088?redirect=false)

Contributor guide

Open the contributing guide

Research direction

Start by examining the Surefire plugin entry points that process Maven properties such as -Dsurefire.chunks and -Dsurefire.chunk, along with the existing excludesFile handling. Define how tests are assigned to chunks and how optional timing data would affect distribution; done means independent Maven runs select the intended test subset without external state.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.