This is for ios Swift project. We are not getting any coverage in sonarqube but other datas like code smells, bugs are displayed.
we tried certain trial and error by including/excluding in sonar-project.properties, but no luck. we tried setting sonarqube in local, still same issue like except coverage other datas are published.
In xcode, we could see the coverage around 53% something. cobertura.xml file created through slather shows all the relavant details of coverage information with %.
Referred documentation but still need expert’s help in fixing this sonar issue. sharing the tools and its version below:
sonarqube - 8.9.6 (community version)
xcode - 15.2
slather plugin - 2.8.0
fastlane-lizard plugin - 1.3.3
fastlane - 2.219.0
cobertura.xml for coverage
sonar-project.properties:
sonar.host.url=org sonar url
sonar.token=xxxx
#----- Default source code encoding
sonar.sourceEncoding=UTF-8
sonar.language=swift
sonar.projectBaseDir=.
sonar.sources=Packages/Account/Sources
sonar.tests=Packages/Account/Tests
sonar.projectKey=xxx
sonar.projectName=xxx
sonar.swift.coverage.reportPattern=sonar-reports/cobertura.xml
sonar.junit.reportsPath=sonar-reports/junit.xml
sonar.swift.coverage.reportsPath=sonar-reports/cobertura.xml
sonar.flex.cobertura.reportPath=sonar-reports/cobertura.xml
sonar.cobertura.reportPath=sonar-reports/cobertura.xml
sonar.scm.provider=git
sonar.exclusions=/*.xml,Pods//,**/.sh,/*.jar,fastlane/,DerivedData/,/Mock/**
sonar.swift.lizard.report=sonar-reports/lizard-report.xml
Note: tried below method too
slather (–sonarqube_xml) for generic data, still didnt get coverage.
error: failed to parse slather
It would be great if setup a discussion call for fixing this if possible.