Issue Details (XML | Word | Printable)

Key: MPDASHBOARD-17
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Vincent Massol
Reporter: pkernevez
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Dashboard Plugin

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

Created: 09/Nov/04 07:01 AM   Updated: 27/Oct/05 03:33 PM   Resolved: 13/Mar/05 12:11 PM
Return to search
Component/s: None
Affects Version/s: 1.6
Fix Version/s: 1.8

Time Tracking:
Not Specified

File Attachments: 1. Text File junitratediff.txt (1 kB)



pkernevez added a comment - 09/Nov/04 07:05 AM

Patch


Vincent Massol added a comment - 09/Nov/04 07:56 AM

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


Steven Caswell added a comment - 14/Dec/04 01:43 PM

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.


Kaloyan Enimanev added a comment - 13/Mar/05 09:23 AM

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


Vincent Massol added a comment - 13/Mar/05 12:11 PM

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


Arnaud Heritier added a comment - 27/Oct/05 03:33 PM

Should be closed for a long long time ago