CI: Azure DevOps
We have a Sonarcloud project that analyzes our React Project. Everything works just fine except for the Code coverage, because during the task SonarCloudAnalyze@1 the JaCoCo XML Report Importer can not find a coverageReport.
We already create a Cobertura Coverage Report, which is created and shown in the Azure Pipeline Code Coverage Tab.
However I have not found a way to use the cobertura-coverage.xml file as the source for the reportPath of the Sonarcloud, since the only Cobertura reportPath Variables seem to be for Flex and Python.
What I have tried:
Set the extraProperties Variable in SonarcloudPrepare to different reportPaths (generic, jacoco…):
task: SonarCloudPrepare@1 inputs: SonarCloud: 'SonarCloud' organization: 'orga' scannerMode: 'CLI' configMode: 'manual' cliProjectKey: 'project' cliSources: './src' extraProperties: | sonar.coverage.jacoco.xmlReportPaths='./coverage/cobertura-coverage.xml' sonar.verbose=true
Which obviously does not work and leads to the output:
So question Nr. 1 would be: Is there a way to use that Cobertura Coverage Report for Sonarcloud or do I have to produce two different reports?
2. If I have to produce two different reports, how do I create the Jacoco Report, since all I have found is creating Jacoco reports with Maven projects, but not React apps?
Any help is appreciated!