versions used: AzureDevops Server 2019.1 / SonarQube Community 6.7.7 / Flex Plugin 2.5.1 / Scanner 4.1.0.1829
error observed: no cobertura coverage info
Hi, within an Azure Devops Server build Pipeline, a cobertura coverage report is generated (with an ng test --code-coverage=true --sourceMap=false call)
The cobertura report is OK, since coverage info is well displayed within AzureDevopsServer
However, upon calling the sonar scanner, the report parameter (sonar.flex.cobertura.reportPath=./coverage/cobertura-coverage.xml) seems to be ignored, as no mention of cobertura appears with a -X flagged analysis
No path issue though as if I use the generic coverage parameter, it chokes on ill formed xml. I may provide the coverage report if necessary.
Even with a fake path like: sonar.flex.cobertura.reportPaths=fake/cobertura-coverage.xml I donât get any hit:
10:33:53.259 DEBUG: âFlex Coberturaâ skipped because there is no related file in current project
10:33:53.259 DEBUG: âFlex Coberturaâ skipped because there is no related file in current project
Iâll try with an Oracle JDK and not an AdoptOpenJDK one
Please next time be more explicit that you are analyzing TS code (adding typescript tag will help to avoid confusion). Using Flex property to import coverage for TS is clearly not a way to go (only coverage on Flex files will be saved).
So I can suggest you 3 ways to go:
generate LCOV coverage report for your TS code and import it with sonar.typescript.lcov.reportPaths or sonar.javascript.lcov.reportPaths (since SonarTS 2.0/SonarJS 6.0).
convert your cobertura report into generic sonarqube coverage format (check docs here)
try to find community plugin which import cobertura on any language
P.S. Please consider updating SQ you are using, you are using old LTS, the new one is 7.9. Otherwise we might not being able to help you as the version you are using is not maintained
@Lena Hi, and you are totally right, I should have set this tag.
Indeed, I also came to the conclusion that the sonar.javascript.lcov.reportPaths was the way to go, and that for typescript, the flex plugin wasnât necessary at all.