Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins: None of the test reports contained any result

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

like image 254
Zangdar Avatar asked Dec 26 '18 17:12

Zangdar


People also ask

How do I view test reports in Jenkins?

You get to the Test Result page by clicking a build link on the Status or History page of your Jenkins project, or by clicking Test Result in the menu on the left. Click the image to enlarge it. At the top of the page, Jenkins displays summary information about the executed tests and their total execution time.

How do I get JUnit test report in Jenkins?

To publish JUnit Test result reports, JUnit Plugin needs to be installed on Jenkins. Under Post Build action, we can see the option of the JUnit test result report, and after giving relevant information, we can trigger build and see the report.


2 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.

like image 109
Zangdar Avatar answered Sep 20 '22 10:09

Zangdar


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
}
like image 38
Dharmesh Purohit Avatar answered Sep 22 '22 10:09

Dharmesh Purohit