apache / apache/maven-surefire

[SUREFIRE-1346] surefire-reports overwrite each other when using reuseForks=false

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

Description

**[Antoine Tran](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=antoine.tran)** opened **[SUREFIRE-1346](https://issues.apache.org/jira/browse/SUREFIRE-1346?redirect=false)** and commented

In a Maven project with the setting "\false\" and TestNg, the file testng-result.xml gets overwritten by the last test.

I somehow understand why it is difficult to avoid this by design of fork, but a workaround solution, as suggested by SUREFIRE-1018 or SUREFIRE-446, is to use the individual TEST-[className].xml files.

However, if I use a Jenkins plugin like testng, I cannot make him ingest these files, as they do not have the same structure as testng-result.xml. This is a bug of testng, rather than the Jenkins plugin testng. Couldn't we make testng-result-[className].xml, for each test, with the testng-result.xml structure? Otherwise, the Jenkins plugin https://wiki.jenkins-ci.org/display/JENKINS/testng-plugin is completely not usable.

Thank you.

---

**Affects:** 2.19.1

**Issue Links:**
- [SUREFIRE-446](https://issues.apache.org/jira/browse/SUREFIRE-446) Surefire fails to capture TestNG results when forkMode=always
(_**"duplicates"**_)
- [SUREFIRE-875](https://issues.apache.org/jira/browse/SUREFIRE-875) testng-results contains only last suite execute in forkmode = always
(_**"duplicates"**_)
- [SUREFIRE-1018](https://issues.apache.org/jira/browse/SUREFIRE-1018) surefire-reports overwrite each other when using forking
(_**"duplicates"**_)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked SUREFIRE-446, SUREFIRE-875, and SUREFIRE-1018 issues to understand existing fork and report behavior. Reproduce the TestNG case with reuseForks=false and verify that each test produces a distinct testng-result-[className].xml with the testng-result.xml structure, rather than later results overwriting earlier ones.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.