|
Hi all,
I am facing with a strange issue and I cannot find which class I need to debug. After parsing the erlang unit test results I can generate an xml like this: <tests-details>
<testcase status="PASSED" time="0.001" name="cr_eunit:init_test_/0_26"/> <testcase status="ERROR" time="0.0" name="cr_eunit:get_and_update_test_/0_48">
<error message="::undef"><![CDATA[]]></error> </testcase>
</tests-details> But on the GUI none of the status of my tests (regardless is it passed or failed or ended in error) is displayed and also the message is not there... Any idea what is wrong with this format? Is there any xsd dtd about it? Is it lowercase uppercase sensitive?
I save it with: context.saveMeasure(unitTestFileResource, new Measure(CoreMetrics.TEST_DATA, report.getTestSuite().toXml())); As I can recall I used the concept what PHP plugin uses. Thanks for helping, Cheers Tamas
|
|
Hi Tamas,
This format comes from JUnit. I'm not aware of a DTD or XSD schema. I attached a report sample with test failures to this email. It shows that your status values are different. Correct values are ok, error, failure and skipped. It will probably fix the issue. Regards Simon On 7 June 2012 16:42, Tamás Kende <[hidden email]> wrote: Hi all, |
|
Hi Simon,
thanks, that was the problem... Regards, Tamas
On Fri, Jun 8, 2012 at 9:58 AM, Simon Brandhof <[hidden email]> wrote: Hi Tamas, |
|
In reply to this post by Simon Brandhof
Dear Simon,
Yesterday, during adding some tests to the sonar erlang plugin, I tried to find the schema of Junit XML. I have found these stuffs:
and non of these mentioned the status attribute... I could not find it in my junit reports either... where is this status come from?
anyway I have added this to my junit xsd. And one more thing. The schema and most of the junit xml reports contains the output in the <failure> or <error> tags but if I add it there it is ignored by Sonar GUI only the content of the message attribute is parsed... Or I do something wrong?
Cheers Tamas On Fri, Jun 8, 2012 at 9:58 AM, Simon Brandhof <[hidden email]> wrote: Hi Tamas, |
|
Hi,
In fact format, which can be recognized by Sonar, comes from maven-surefire-plugin : https://github.com/apache/maven-surefire/blob/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/XMLReporter.java
Hope this can help.
On Thu, Jun 21, 2012 at 6:17 PM, Tamás Kende <[hidden email]> wrote: Dear Simon, Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
Hi,
well... :) the status not mentioned in this code as well, but it is important, because it defines the icon on the Sonar GUI. It is also strange, that only the content of the attribute message is displayed and the content of the error/failure tag, what is the "stacktrace", is ignored... is it intentionally?
Thank you for your answer, Cheers, Tamas
On Thu, Jun 21, 2012 at 2:24 PM, Evgeny Mandrikov <[hidden email]> wrote: Hi, |
|
Well, seems that there is misunderstanding :
We (I and Simon) talked about format which understood by sonar-surefire-plugin, or more precisely which can be parsed by https://github.com/SonarSource/sonar/blob/master/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/SurefireStaxHandler.java
Whereas you talk about format of measure as it should be stored in Sonar DB : https://github.com/SonarSource/sonar/blob/master/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestClassReport.java#L88
Do you confirm my feelings? ;) On Thu, Jun 21, 2012 at 7:39 PM, Tamás Kende <[hidden email]> wrote: Hi, Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
:) yes
ok its getting more clear now... Now I know what I needed is the schema what SurefireStaxHandler can understand (which is produced by UnitTestClassReport.toXml in my understanding)... as I see now, my toXml implementation is the same as surefire plugin's, so it is fine... the xsd what I have created can confirm it...
Thank you for your help, Cheers Tamas On Thu, Jun 21, 2012 at 3:55 PM, Evgeny Mandrikov <[hidden email]> wrote: Well, seems that there is misunderstanding : |
|
See my comments below : On Thu, Jun 21, 2012 at 8:27 PM, Tamás Kende <[hidden email]> wrote: :) yes Format which understood by SurefireStaxHandler isn't the same as produced by UnitTestClassReport.toXml To be more precise : SurefireStaxHandler is able to read format of JUnit XML reports and produce another format, which is described by UnitTestClassReport and which is saved in Sonar DB.
Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
Yes, you are right, I have mixed it.
Thanks Tamas
On Thu, Jun 21, 2012 at 4:33 PM, Evgeny Mandrikov <[hidden email]> wrote:
|
| Powered by Nabble | Edit this page |
