SonarQube - * Enterprise Edition * Version 9.3 (build 51899)
Scanner - SonarQube Scanner 4.6.2.2747
Xcode Version 13.2 (13C90)
Apple LLVM version 13.0.0 (clang-1300.0.29.30)
We are generating a coverage report like so
- swift test --enable-code-coverage
- xcrun llvm-cov show
-use-color=false
-instr-profile=.build/debug/codecov/default.profdata
-output-dir=Sonar
.build/debug/NetworkingPackageTests.xctest/Contents/MacOS/NetworkingPackageTests
which results in a
Sonar/Index.txt
Sonar/coverage/…/… contains the directory structure with single source file coverage data
in sonar-project.properties we have configured
sonar.swift.coverage.reportPaths=Sonar/Index.txt
The following are also configured (details partially left out)
sonar.projectKey=
sonar.projectName=
sonar.projectVersion=
sonar.projectDescription=
sonar.language=swift
sonar.sources=./Sources
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
sonar.test.inclusions=.swift
sonar.exclusions=/Test/,**/.xml,Pods//*,Reports//*
sonar.swift.appName=
sonar.sourceEncoding=UTF-8
sonar.swift.excludedPathsFromCoverage=.Tests.
After running sonar-scanner with the specified parameter
the jobs run successfully and we see all the files from the coverage directory but the overall coverage is reported 0% in the single source files all covered lines are marked red in SonarQube.
Do we miss something here?
Kind regards