apache / apache/maven-surefire
[SUREFIRE-1816] XML Report Is generated incorrect only for failed tests in TestFactory or when rerunFailingTestsCount>0
- Dominant language
- Java
- Stars
- 461
- Forks
- 588
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 19
Description
**[Iuri Litvinov](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ilitvinov)** opened **[SUREFIRE-1816](https://issues.apache.org/jira/browse/SUREFIRE-1816?redirect=false)** and commented
We have TestFactory with DynamicTests like in example. If rerunFailingTestsCount>0 and one of the tests are failed, the plugin generates XML with only one test or only passed tests.
If rerun is 0 or all tests passed, everything is ok.
TestFactory:
```java
@Tags(Tag("w"))
@Execution(SAME_THREAD)
@TestFactory
fun `Factory tests`() = iterator {
yield(dynamicTest("Test1") {
assert(false)
})
yield(dynamicTest("Test2") {
assert(true)
})
}
```
Pom contains:
```java
maven-failsafe-plugin
3.0.0-M4
false
UTF-8
false
false
true
true
false
false
false
true
true
true
3.0
false
classes
${fork.count}
${fork.count}
false
-Xmx2048m
1
${includeRule}
${excludeRule}
${tags}
${project.build.directory}/failsafe-reports/${timestamp}
junit.jupiter.extensions.autodetection.enabled
true
${osVersion}
${device}
integration-test
verify
```
---
**Affects:** 3.0.0-M4
Contributor guide
Research direction
Start with the JUnit5StatelessTestsetReporter and JUnit5ConsoleOutputReporter configurations shown in the issue, then trace XML report generation for dynamic tests when rerunFailingTestsCount is 1. Reproduce the TestFactory case with one failing and one passing test, and verify that the XML contains both tests and correct failure information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100