Maven 1.x Dashboard Plugin

No division by zero when no test in project with junitpassrate.jelly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.6
  • Fix Version/s: 1.8
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Activity

Hide
pkernevez added a comment -

Patch

Show
pkernevez added a comment - Patch
Hide
Vincent Massol added a comment -

Hi Philippe,

Thanks for the patch. However, we already have a test for this and the test is passing for us (the test can be found in CVS, in src/plugin-test/subproject2). As you can see the subproject2 project has not unit tests. The dshboard is correctly generated with a "-" as the junit passrate. Could you have a look and tell us what's different in your case?

Thanks

Show
Vincent Massol added a comment - Hi Philippe, Thanks for the patch. However, we already have a test for this and the test is passing for us (the test can be found in CVS, in src/plugin-test/subproject2). As you can see the subproject2 project has not unit tests. The dshboard is correctly generated with a "-" as the junit passrate. Could you have a look and tell us what's different in your case? Thanks
Hide
Steven Caswell added a comment -

I ran across the same problem. The reason subproject2 puts in a dash instead of encountering divide by zero is that subproject2 does not have a src/test directory, therefore no TESTS-TestSuites.xml is generated. This means the aggregator logic never tries to look at the number of tests, therefore it never gets to the division.

I created a separate test subproject with an empty src/test that duplicates the situation, along with verifications in maven.xml, to verify this behavior. I can post these patches if you'd like.

Show
Steven Caswell added a comment - I ran across the same problem. The reason subproject2 puts in a dash instead of encountering divide by zero is that subproject2 does not have a src/test directory, therefore no TESTS-TestSuites.xml is generated. This means the aggregator logic never tries to look at the number of tests, therefore it never gets to the division. I created a separate test subproject with an empty src/test that duplicates the situation, along with verifications in maven.xml, to verify this behavior. I can post these patches if you'd like.
Hide
Kaloyan Enimanev added a comment -

Hi guys,
I've ran across the same problem.

Here is my situation

I have a test folder, but it containts tests that are NOT JUnit tests. They are some OSGI bundle - tests. So I have declared 'exclude' mask for them in the unitTest tag in the POM file.

This works perfectly, until I start to use dashboard.
I have a module that has ONLY OSGI tests - not a single JUnit.
A 'junit-report.xml' file is created for the module, but the evaluation of the expression for calculation of JUnit percentage does not work because all numbers are zeroes.
Here is part my junit-report.xml

<pre>
<table summary="JUnit result summary">
<thead>
<tr>
<th>Tests</th>
<th>Errors</th>
<th>Failures</th>
<th>Success rate</th>
<th>Time(s)</th>
</tr>
</thead>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>?</td>
<td>0.00</td>
</tr>
</table>

</pre>

best regards,
and many many thanks for the wonderful plugin,

Kaloyan

Show
Kaloyan Enimanev added a comment - Hi guys, I've ran across the same problem. Here is my situation I have a test folder, but it containts tests that are NOT JUnit tests. They are some OSGI bundle - tests. So I have declared 'exclude' mask for them in the unitTest tag in the POM file. This works perfectly, until I start to use dashboard. I have a module that has ONLY OSGI tests - not a single JUnit. A 'junit-report.xml' file is created for the module, but the evaluation of the expression for calculation of JUnit percentage does not work because all numbers are zeroes. Here is part my junit-report.xml <pre> <table summary="JUnit result summary"> <thead> <tr> <th>Tests</th> <th>Errors</th> <th>Failures</th> <th>Success rate</th> <th>Time(s)</th> </tr> </thead> <tr> <td>0</td> <td>0</td> <td>0</td> <td>?</td> <td>0.00</td> </tr> </table> </pre> best regards, and many many thanks for the wonderful plugin, Kaloyan
Hide
Vincent Massol added a comment -

Applied. Thanks and sorry for the long time it has taken me to apply it...

Show
Vincent Massol added a comment - Applied. Thanks and sorry for the long time it has taken me to apply it...
Hide
Arnaud Heritier added a comment -

Should be closed for a long long time ago

Show
Arnaud Heritier added a comment - Should be closed for a long long time ago

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: