The coverage of my project is not shown neither in sonarqube nor in sonarcloud it is 0%k

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:

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 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"/>

My contains the following: sonar.projectKey=swift-coverage-example11

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 (607 Bytes)


Welcome to the community!

What this is telling you is that SonarQube (and SonarCloud) can’t correlate the files listed in your coverage report with the files its finding in analysis.

You need to make sure the path SonarQube sees for E.G. AppDelegate.swift matches the path that’s in your coverage report.


Hello Thanks for answering, a query, this is the example project that I have (GitHub - JeremyRoman99/IosCodemagicprueba123) there in the test folder are all the files related to the xml and in the xml test that I shared with you You also say the path <file path="Test/swift-coverage-example/AppDelegate.swift">, I thought that sonarqube was not finding the xml in my project and I decided to also put it in the administration-> Configuration-> part Jacoco and put the route there in this case if you find sonarqube-generic-coverage.xml in the root but it still doesn’t show me the coverage.


Take a closer look at my initial reply, please.