SonarSource / sonar-scanning-examples

Shows how to use the Scanners
GNU Lesser General Public License v3.0
894 stars 2.24k forks source link

sonar-scanner throws parsing error for sonarqube-generic-coverage.xml #100

Closed satyadev-chauhan closed 3 years ago

satyadev-chauhan commented 3 years ago

Error generic coverage report: INFO: ------------- Run sensors on project INFO: Sensor Generic Coverage Report INFO: Parsing /Users//sonarqube-generic-coverage.xml INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 2:58.549s INFO: Final Memory: 63M/240M INFO: ------------------------------------------------------------------------ ERROR: Error during SonarScanner execution ERROR: Error during parsing of the generic coverage report '/Users//sonarqube-generic-coverage.xml'. Look at SonarQube documentation to know the expected XML format.

Description: The sonar-scanner throws parsing error for sonarqube-generic-coverage.xml when file size >2MB generated by xccov-to-sonarqube-generic.sh. The coverage reports are generated for Generic Coverage correctly as per https://docs.sonarqube.org/latest/analysis/generic-test/

Screenshot 2021-01-08 at 2 37 54 PM

The project uses swift and objective-c language. The reporting is successful when the sonarqube-generic-coverage.xml is around 2MB.

Screenshot 2021-01-08 at 2 29 14 PM

Info: SonarScanner 4.5.0.2216 Java version 8, 11, 15 Mac OS X 10.15.6 x86_64

satyadev-chauhan commented 3 years ago

Got this working with https://github.com/mysugr/cococo

Instead of using this: bash xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml

Use this: cococo Build/Logs/Test/*.xcresult > sonarqube-generic-coverage.xml

niharamin86 commented 3 years ago

Running into the same but even cococo has been deprecated. https://github.com/mysugr/cococo Does anyone have a solution ?

okorach commented 3 years ago

This repo is a sample of how to scan projects. If you have problems on your own projects please post on the SonarSource community forum, not here. See https://community.sonarsource.com