junit plugin not showing results from all tests in jenkins
I think you are encountering a Jenkins issue here.
Jenkins uses the attributes classname
as well as testname
of a <testcase>
within a JUnit XML report to classify test results on the UI. Furthermore Jenkins expects the classname
to be composed of a package name followed by a single dot and then a class name:
<testcase classname="packagename.classname" name="testname">
If no dot is present, Jenkins assumes the package "root". If multiple dots are present, only the last dot is recognized as separator. See this question for a better explanation.
If you look at your XML reports above you can notice, that the XML of the unit tests specify a package name in the classname
attribute, while the XML of the jasmine reporter does not. I think the missing package name is the reason, why the test results are not showing up. Apparently Jenkins uses the package "root" only, if there are no packages present at all. If there is at least one test case with a package name, all other test cases without a package are "lost".
There are two possible solutions:
- Report a bug for Jenkins since above behavior is unexpected
- Modify the jasmine reporter to construct a
classname
of the patternpackage.class
. There is a pull request at https://github.com/larrymyers/jasmine-reporters/pull/186/files that would allow modifications of the classname by a user function.