SonarCloudAnalyze cannot import Cobertura XML file

Hello,

We are using SquishCoco for C/C++ to do code coverage analysis. It should now be possible to import these results via a Squish exported cobertura file.
Using sonar.cfamily.cobertura.reportPaths=$(System.DefaultWorkingDirectory)/coverage_all_unittests.xml I am trying to import these results into SonarCloud, which should be possible now looking at some forum posts.
During the SonarCloudAnalyze, the file detected and read, but an exception occurs:

##[error]16:55:17.826 ERROR Error during SonarScanner Engine execution
com.sonar.cpp.plugin.visualstudio.XmlParserHelper$ParseErrorException: Unexpected closing element "line", expecting "conditions" in C:\a\1\s\coverage_all_unittests.xml at line 15
	at com.sonar.cpp.plugin.visualstudio.XmlParserHelper.parseError(XmlParserHelper.java:135)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.enteringElement(CoberturaParser.java:78)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.skipConditions(CoberturaParser.java:234)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.parseLine(CoberturaParser.java:210)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.parseLines(CoberturaParser.java:187)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.parseClasses(CoberturaParser.java:140)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.parsePackages(CoberturaParser.java:120)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.parseReport(CoberturaParser.java:98)
	at com.sonar.cpp.plugin.cobertura.CoberturaParser.parse(CoberturaParser.java:71)
	at com.sonar.cpp.plugin.cobertura.CoberturaSensor.lambda$execute$2(CoberturaSensor.java:47)

The exported file indeed does not have the ‘conditions’ section. Azure devops itself has no problem loading the xml file.

Are there options for the analyze step to load this file?

Thank you

Hi @PPRiphagen and welcome to the community,

Would it be possible for you to share the coverage_all_unittests.xml file you are trying to import with us? This can help us identify the issue more easily on our side…

I can also start a private thread with you if you would like to share the file privately…

Thanks,
Michael

Hi @michael.jabbour thank you for the welcome

I’m fine in sharing the coverage xml, but would indeed prefer to do this in a private thread

Thank you
Patrick

1 Like

Hi @PPRiphagen, and thanks for sharing the file with us,

We identified the problem on our side, and we opened a ticket to implement a solution [CPP-5634] - Jira.

Best regards,
Michael

Hi Michael

Thank you very much. You have an idea of the timeline when this will be picked up?

Patrick

Hi @PPRiphagen, and thanks again for taking the time to share the problem with us,

I am afraid we can’t provide a time commitment at the moment, but we will address the issue as promptly as possible, in accordance with our priorities. Stay tuned!

Best regards,
Michael