Hello there,
How does Develocity parses JUnit5 surefire test results?
Examples :
ParameterizedTest :
public class HelloWorldTest {
@ParameterizedTest(name = "{0}")
@ValueSource(strings = {"hello", "world"})
void test(String param){
assertThat(param).isNotNull();
}
}
Test with a custom DisplayName
@Test
@DisplayName("My custom display name")
void sampleDisplayNameTest(){
assertThat(1).isGreaterThan(0);
}
XML report produced by JUnit5Xml30StatelessReporter
:
<testcase name="My custom display name" classname="HelloWorldTest" time="0.229"/>
<testcase name="test(String) hello" classname="HelloWorldTest" time="0.04"/>
<testcase name="test(String) world" classname="HelloWorldTest" time="0.002"/>
Plain text report :
-------------------------------------------------------------------------------
Test set: HelloWorldTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.442 s -- in HelloWorldTest
HelloWorldTest.sampleDisplayNameTest -- Time elapsed: 0.229 s
HelloWorldTest.test(String)[1] -- Time elapsed: 0.040 s
HelloWorldTest.test(String)[2] -- Time elapsed: 0.002 s
I can only guess as the source code is private, but Develocity seems to be parsing the Plain text report (target/surefire-reports/testName.txt) that do not contain any information about the custom display name or the parameter names. That creates reports that are not as useful as they could be
Do you know if this can be changed?