Jenkins: None of the test reports contained any result

Viewed 9040

I am trying to register JUnit tests results with Jenkins. This is not the first time I do that, I have a handmade test framework made for Matlab, which generate a handmade Junit test report, feed it to Jenkins, and it works flawlessly.

In this case, it is much more simple, I am using Junit5 to unit-test Java code. It is built with gradle. The tests reports are correctly generated, I archive them into Jenkins and they are present. But I am still getting the following message:

[Pipeline] junit Recording test results None of the test reports contained any result

Which I do not understand, could anything be wrong into the test report ? I attached one of them so maybe someone can help me troubleshot this error:

Thank you very much because I am a bit lost with this

3 Answers

Turns out that this is a misleading message, it will occurs if NO tests reports are found if you allow empty archives to not fail the build (which is the case here, some java plugin generate tests, some other don't).

In this case it was a typo in the path. For some reason the files were archived correctly, even with the typo (?!).

I am letting this post here with the answer, just removed the link, in case someone run into the same misleading error message.

I was also facing similar issue. The resolution I got is I have added xmlVersion as null. Here is the code for me that worked :

junitReporter: {
outputDir: 'test-reports',
outputFile: 'unit-test-report.xml',
useBrowserName: false,
xmlVersion: null
}

You can also just check this when configuring your workspace and it will remove the error if you don't care about the empty results.

enter image description here

Related