We are using SonarCloud with my new employer and I’m facing a pretty strange issue with code coverage calculation on new code.
My Objective-C project is up and running, I’ve manually analyzed the
develop branches with
master branch has 0% coverage from Xcode and the
develop branches reaches 98.8%. SonarCloud, for both branches, reported that the coverage was 0% since I didn’t run the
slather command to give them a generic coverage file.
So I’ve recently opened a PR from
develop to fix some bugs & code smells reported by SonarCloud and I’ve also added a new UT to reach the 100% coverage on Xcode. And since the CI is now handling the whole thing, it runs the
slather action by itself with fastlane.
Unfortunately, I can’t merge my PR because SonarCloud reports a 0% coverage on new code:
At some point, adding a dummy method fixed the issue but was compliant with our production workflow and it doesn’t work anymore
Here’s a screenshot of the
sonarqube-generic-coverage.xml file showing that there is coverage:
And here’s the content of the sonar-project.properties:
sonar.cfamily.build-wrapper-output=bw-output sonar.sourceEncoding=UTF-8 sonar.coverageReportPaths=output/sonarqube-generic-coverage.xml
Maybe I am doing something wrong, do you have any insight or ideas about this?
Thanks in advance.
Version: SonarCloud (Developer 500k)