- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube 7.1 Community Edition (running in docker in Azure Web App Linux for containers), In my Azure Build Pipeline I’m using following extension (https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube), Node.js.
- what are you trying to achieve
I want to have code coverage non zero (0) in my SonarQube report and also if it possible I want to have content of junit.xml test result file which generated by jest-junit in my SQ report. In my build pipeline in Azure Devops I’m using cobertura-coverage.xml and junit.xml without any issue both reports works fine.
- what have you tried so far to achieve this
Honestly I think I tried everything. I spent almost three days without any success.
In run code analysis task I’m using sonar-project.properties file.I tried following and some other parametes combinations of parameters (none of this parameters didnt help me):
In my package.json I have following part:
“testci”: “react-scripts test --ci --reporters=jest-junit --reporters=default --coverage --coverageReporters=cobertura --coverageReporters=lcov --coverageReporters=html --transformIgnorePatterns “node_modules/(?!@amcharts)/””,
I executing “npm run testci” as part of my pipeline and got following bunch of reports:
and also client/junit.xml.
Could you please help me to figure out how to get code coverage and test results in SonarQube report.