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
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.
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.
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With