Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error when parsing report with Sonar #81

Closed
ahmehri opened this issue Feb 17, 2016 · 3 comments
Closed

Error when parsing report with Sonar #81

ahmehri opened this issue Feb 17, 2016 · 3 comments

Comments

@ahmehri
Copy link

ahmehri commented Feb 17, 2016

When generating a report as the following:

<?xml version="1.0"?>
<testsuite name="Chrome 47.0.2526 (Linux 0.0.0)" package="" timestamp="2016-02-17T16:40:49" id="0" hostname="" tests="34" errors="0" failures="0" time="0.6">
  <properties>
    <property name="browser.fullName" value="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36"/>
  </properties>
  <testcase name="test" time="0.049" classname="Chrome_47_0_2526_(Linux_0_0_0).Filter: stripExtension"/>
  <system-out>
    <![CDATA[
]]>
  </system-out>
  <system-err/>
</testsuite>

and after parsing it with Sonar, an error occurred:

ERROR: Caused by: Unknown XML node, expected "unitTest" but got "testsuite"

@jpaulin
Copy link
Contributor

jpaulin commented Feb 21, 2016

This seems to basically say that Karma JUnit reporter has been configured to use a naming convention true to test code (source), whereas Sonar expects something different.

The karma-junit-reporter produces lines to the test report so that it makes a tag for a test class (usually that's a physical single file), and within the test suites there are tags, one for each named test spec.

Can you configure both ends, Karma and the Sonar? A question that might help check out the options available.

@ahmehri
Copy link
Author

ahmehri commented Feb 22, 2016

@jpaulin Sonar uses a specific XSD schema for the report. A sample of a compliant file can be found here in the section Unit Tests Execution Results Report Format. Therefore I don't think that there is a possible configuration at Sonar side.

@jehon
Copy link

jehon commented Jan 16, 2017

Coming accross the same problem.
I see this bug too about the same problem: #78

@ahmehri ahmehri closed this as completed May 23, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants