Xcode code coverage

  • ALM used Azure DevOps
  • CI system used Azure DevOps
  • Scanner command used when applicable SonarCloudAnalyze@3
  • Languages of the repository Swift
  • Error observed (wrap logs/code around with triple quotes
##[error]01:28:31.749 ERROR Coverage report '/Users/vm1/agent/_work/1/coverage/cobertura.xml' could not be read/imported. Error: {}
java.lang.IllegalStateException: Invalid report: expected to find 'line' within a 'sourcefile' at line 13 column 13
	at org.sonar.plugins.jacoco.XmlReportParser.parse(XmlReportParser.java:89)
	at org.sonar.plugins.jacoco.JacocoSensor.importReport(JacocoSensor.java:72)

  • Steps to reproduce
  • run Xcode tests
  • run slather to output cobertura.xml report
  • execute SonarCloudAnalyze@3 task
  • execute SonarCloudPublish@3 task
  • Potential workaround

Hey there.

You’ll need to ask slather to generate a report in the sonarqube_xml and import this report using the sonar.coverageReportPaths analysis parameter, rather than the sonar.coverage.jacoco.xmlReportPaths you’re trying to use.

1 Like

Hi Colin,

I just figured that out this morning. Thanks for your reply though!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.