jenkinsci / jenkinsci/junit-plugin

[JENKINS-51702] Summarize history of same test case executed in different parallel splits

Open
#1,107 1 comment 0 reactions 0 assignees View on GitHub
component:junit-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
87
Forks
351
Avg merge
1d 19h
Merged PRs (30d)
2

Description

I am using the Parallel Test Executor plugin, so my unit tests are splitted into splits executed in parallel on different nodes. This is a simplified part of my Jenkinsfile:

 

#!/usr/bin/env groovy

stage('Test') {
  def testSteps = [:]
  def splits = splitTests parallelism: count(env.NUMBER_EXECUTORS as int)
  for (int i = 0; i < splits.size(); i++) {
    def num = i
    def split = splits[num]
    testSteps["Test split${num}"] = {
      node('!master') {
        checkout scm
        writeFile file: ("test_exclusions.txt"), text: split.join("\n")
        sh './gradlew test'
        junit '**/build/test-results/**/TEST-*.xml'
      }
    }
  }
  parallel testSteps
}


 

We make heavy use of the test result history to see when the build first broke and who is responsible for that.

The issue I am facing is the fact that the ID of the test result contains the name of the parallel execution step as the prefix, in this case "Test split2" for example. As a result, a broken test is shown in the history as "Test / Test split2 / my.package.MyTest.testStuff()".

This is nice in theory, but there is one issue: The history only shows me the history of a test case executed in this specific split. For example, it may be that  "Test / Test split2 / my.package.MyTest.testStuff()" is shown as broken with an age of 1, although it may be broken since multiple builds, just that this specific test case happened to be put into different splits before.

To summarize: "Test / Test split2 / my.package.MyTest.testStuff()" and "Test / Test split3 / my.package.MyTest.testStuff()" have separate histories, but I need to track their histories together.

 

---
Originally reported by christianciach, imported from: Summarize history of same test case executed in different parallel splits


  • status: Open
  • priority: Minor
  • component(s): junit-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 2
  • imported: 2025-11-26

Raw content of original issue

I am using the Parallel Test Executor plugin, so my unit tests are splitted into splits executed in parallel on different nodes. This is a simplified part of my Jenkinsfile:

 



#!/usr/bin/env groovy

stage('Test') {
  def testSteps = [:]
  def splits = splitTests parallelism: count(env.NUMBER_EXECUTORS as int)
  for (int i = 0; i < splits.size(); i++) {
    def num = i
    def split = splits[num]
    testSteps["Test split${num}"] = {
      node('!master') {
        checkout scm
        writeFile file: ("test_exclusions.txt"), text: split.join("\n")
        sh './gradlew test'
        junit '**/build/test-results/**/TEST-*.xml'
      }
    }
  }
  parallel testSteps
}



 

We make heavy use of the test result history to see when the build first broke and who is responsible for that.

The issue I am facing is the fact that the ID of the test result contains the name of the parallel execution step as the prefix, in this case "Test split2" for example. As a result, a broken test is shown in the history as "Test / Test split2 / my.package.MyTest.testStuff()".

This is nice in theory, but there is one issue: The history only shows me the history of a test case executed in this specific split. For example, it may be that  "Test / Test split2 / my.package.MyTest.testStuff()" is shown as broken with an age of 1, although it may be broken since multiple builds, just that this specific test case happened to be put into different splits before.

To summarize: "Test / Test split2 / my.package.MyTest.testStuff()" and "Test / Test split3 / my.package.MyTest.testStuff()" have separate histories, but I need to track their histories together.

 

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Start by tracing how the junit-plugin parses test result IDs and builds test history, then reproduce the case with the shown Jenkinsfile and parallel splits. Done means the same test case shares one history even when its parallel split prefix changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.