Hello everyone, I am trying to upload an example project to a local sonarqube (Version 9.4) and it shows me when uploading it that it does not have coverage, so I have investigated by looking at the log when uploading it I get
INFO: Imported coverage data for 0 files
INFO: Coverage data ignored for 3 unknown files, including:
Test/swift-coverage-example/AppDelegate.swift
Test/swift-coverage-example/AppDelegate2.swift
test/swift-coverage-exampleTests/swift_coverage_exampleTests.swift
This from what I see is because the coverage is not being shown in sonarqube, I am guiding myself from this documentation (How to set up SonarQube and integrate it with Codemagic | Codemagic Blog) In the native ios part there is a codemagic that executes a script “bash xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml” will output an .xml something like this.
This is just an example, I will put the xml as an attachment
<coverage version="1">
<file path="Test/swift-coverage-example/AppDelegate.swift">
<lineToCover lineNumber="17" covered="true"/>
<lineToCover lineNumber="18" covered="true"/>
</file>
</coverage>
My sonar-project.properties contains the following: sonar.projectKey=swift-coverage-example11
sonar.sources=Test
sonar.host.url=http://localhost:9000
sonar.coverageReportPaths=sonarqube-generic-coverage.xml
sonar.login=LOGIN
sonar.cfamily.build-wrapper-output.bypass=true
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
Also, from what I know, the sonarqube community accepts xml and I don’t understand why it doesn’t show me a coverage, I have also tried to use a sonarcloud, I made an account and everything continues without success, showing the coverage of my project on that xml that is generated , I will share the xml I will put it in the .rar. Thanks for your time
Sonarqube.zip (607 Bytes)