Code coverage report JUnit + XCPretty + AzureDevops + SonarCloud

swift
coverage
(julien hamon) #1

Hi,

I contact you because i don’t arrive to add my code coverage in my swift project.
In my Azure devops Step, i generate a xml for my test report with XCPretty (xCode 10)
but when i pass the report i have this error.

To set my report i use this :
sonar.coverageReportPaths=$(Build.Repository.LocalPath)/build/reports/junit.xml

And i have this error for result :

Because the key that i use can’t use the junit xml format.

So how i can give my report for swift project ?

Thanks,

Julien Hamon

(Massimo Paladin) #2

Hi @julien404,

you are trying to import a junit formatted xml with Generic Test Data property, that cannot work.

For Swift you should use sonar.swift.coverage.reportPath to point to the path of the coverage report generated from “llvm-cov show”. This path can be either absolute or relative to the project directory.