junit reports incorrectly parsed when generated from maven-surefire-plugin >2.22.2

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When using maven-surefire-plugin or maven-surefire-plugin 3.1.0 (basically everything after 2.22.2), the generated XML files seems to not be properly parsed. Most certainly because the outputted format has changed.

Using Gitlab CE 15.11.2.

What is the current bug behavior?

For example running mvn test will end up with the following output:

[WARNING] Tests run: 2477, Failures: 0, Errors: 0, Skipped: 1

But the UI of gitlab will show: image

When looking at the tests, we can see that some tests have "no name": image

What is the expected correct behavior?

The UI should show this (when using maven-surefire-plugin version 2.22.2): image

Possible fixes

Since v3 of the maven-{surefire,failsafe}-plugin, it seems the legacy XML format was abandoned for a new one, see https://maven.apache.org/surefire/maven-surefire-plugin/history.html

Edited by 🤖 GitLab Bot 🤖