SonarQube: * Version 7.9.1 (build 27448)
I want to get tests coverage for all targets created in the project
iOS (Swift) application is structured on a modular way, where through the main target all other targets (frameworks) are executed when running and testing
This is how my sonar-project.properties file looks like:
sonar.projectKey=projectKey sonar.projectName=projectName-iOS sonar.projectVersion=1.0.0 nca.project.id=id-number sonar.infostore.groupId=groupId.sonar sonar.infostore.artifactId=artifactId-iOS artifactId=artifactIs-iOS sonar.language=swift # Project description sonar.projectDescription=Project description # Path to source directories sonar.sources=. sonar.c.file.suffixes=- sonar.cpp.file.suffixes=- sonar.objc.file.suffixes=- sonar.swift.project=Project.xcodeproj sonar.swift.workspace=Project.xcworkspace sonar.swift.simulator=platform=iOS Simulator,name=iPhone 12,OS=14.5 # Scheme to build your application sonar.swift.appScheme=Project # Path to test directories (comment if no test) sonar.tests=ProjectTests,ProjectUITests,ProjectCoreTests,ProjectAccountsTests,ProjectCardsTests,ProjectPaymentsTests,ProjectDashboardTests,ProjectWebTests,ProjectAuthenticationTests,ProjectAppSettingsTests sonar.test.inclusions=*Tests/*.swift # Encoding of the source code sonar.sourceEncoding=UTF-8 sonar.junit.reportsPath=sonar-reports/ # Exclude directories from tests sonar.exclusions=build/derivedData/SourcePackages/checkouts/**,_assets/*,Certificates/*,fastlane/**,Pinpoint/*,Pods/**/*,Scripts/*,WIP/* sonar.test.exclusions=**/*.xml,sonar-reports/*
Only for main project scheme “Project” unit test coverage is shown and for others (like “ProjectCore”, “ProjectAccounts” etc.) is always 0% of coverage even though it is not like that in the project.
I tried different kind fo combination for inclusion of that code and nothing helped.
Interesting thing is that “Bugs”, “Vulnerabilities”, “Code Smells”, “Security Hotspots”, “Duplications” are showing correct results of percentages but “Coverage” is always 0% for all other targets in the project other that “Project” target.
Please advise in which direction should I go.
Thank you in advance!