This community is reporting that sonar server is supporting Xcode 11 :
Here is a quick guide on importing your Coverage or Test Data reports into SonarQube or SonarCloud. These commands were used when we implemented this feature. If you use other commands, feel free to share them as replies.
If you have trouble importing your Coverage or Test data reports, please ask for help on the corresponding SonarQube or SonarCloud category.
Rely on the “Generic Test Data”
SonarQube supports a generic coverage format , allowing you to load any coverage report as soon as you …
What I have implemented is :
Script as below:
bash ./xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml
touch Coverage.report
sonar-scanner -Dsonar.host.url=* -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.repository=* -Dsonar.pullrequest.github.endpoint=* -Dsonar.pullrequest.key=${ID} -Dsonar.pullrequest.base=master -Dsonar.pullrequest.branch=${BRANCH} -Dsonar.projectKey=* -Dsonar.login=$SONAR_USER -Dsonar.password=$SONAR_PASS -Dsonar.sources=. -Dsonar.coverageReportPaths=sonarqube-generic-coverage.xml -Dsonar.cfamily.build-wrapper-output.bypass=true -Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=- -Dsonar.objc.file.suffixes=- -X
What I am getting error is:
Error: Error Domain=XCCovErrorDomain Code=0 “Failed to load result bundle” UserInfo={NSLocalizedDescription=Failed to load result bundle, NSUnderlyingError=0x7fb1d15286c0 {Error Domain=IDEFoundation.ResultBundleError Code=0 “This version of Xcode does not support opening result bundles created with versions of Xcode and xcodebuild using the v1 API.”}}
Hi Sonar community, I am expecting answer here?
Colin
(Colin)
March 5, 2021, 7:23am
4
Hey Ravi.
This is a free, open community. There’s no expectation that every question will be answered (and certainly not within a day).
And, your organization already has a ticket open through Enterprise support on this topic, currently on your side.
mpaladin
(Massimo Paladin)
March 8, 2021, 8:21am
5
ravi.k.verma:
Error: Error Domain=XCCovErrorDomain Code=0 “Failed to load result bundle” UserInfo={NSLocalizedDescription=Failed to load result bundle, NSUnderlyingError=0x7fb1d15286c0 {Error Domain=IDEFoundation.ResultBundleError Code=0 “This version of Xcode does not support opening result bundles created with versions of Xcode and xcodebuild using the v1 API.”}}
I don’t think this error is affecting the coverage report creation, you may simply ignore this error. See also Unable to import Xcode Coverage data on XCode 12 - #2 by shoaibsadanaut .
The thing is I am getting at the end below error:
[2021-03-08T19:44:19.382Z] 19:44:20.761 INFO: Sensor Generic Coverage Report
[2021-03-08T19:44:19.382Z] 19:44:20.762 INFO: Parsing /Users/vagrant/workspace/cmb_iceberg-ios_PR-5232/build/sonarqube-generic-coverage.xml
[2021-03-08T19:44:20.035Z] 19:44:21.616 INFO: ------------------------------------------------------------------------
[2021-03-08T19:44:20.035Z] 19:44:21.616 INFO: EXECUTION FAILURE
[2021-03-08T19:44:20.035Z] 19:44:21.616 INFO: ------------------------------------------------------------------------
[2021-03-08T19:44:20.035Z] 19:44:21.616 INFO: Total time: 3:37.542s
[2021-03-08T19:44:20.668Z] 19:44:22.204 INFO: Final Memory: 766M/1585M
[2021-03-08T19:44:20.668Z] 19:44:22.205 INFO: ------------------------------------------------------------------------
[2021-03-08T19:44:20.668Z] 19:44:22.205 ERROR: Error during SonarQube Scanner execution
[2021-03-08T19:44:20.668Z] Error during parsing of the generic coverage report ‘/Users/vagrant/workspace/cmb_iceberg-ios_PR-5232/build/sonarqube-generic-coverage.xml’. Look at SonarQube documentation to know the expected XML format.
script returned exit code 1
If go for 2 to 3 test cases - code coverage successfully .
but for more than 2 mb size not successfully, is there any bug with sonar parsing more than 2 mb size?
d4Rk
(Martin Straub)
March 15, 2021, 2:50pm
10