Sonarcloud Code Coverage Not Importing (Sitting at 0%)

My organization has a project with a React.js front-end coupled with an ASP.NET MVC being used as a basic API and router to the front-end. We are using Azure DevOps for our build pipeline:

Jest is being used for testing and code coverage with the following configs:

The pipeline is successfully running, and does seem to spit out a cobertura-coverage.xml file, as well as .html files. I can download and view the code coverage report manually just fine.

During the SonarCloud scan task I can see it ingest the .coverage report and successfully make a conversion. However, code coverage stays at 0%

Apparently I cannot post more than 3 screenshots as a new member here… This is extremely limiting…

Hello @bcorley ,

Welcome to Sonar Community :sonar:

In your SonarQubePrepare task (aka Prepare analysis on SonarCloud), what Sonar coverage parameter are you using to pass the LCOV report? Did you use sonar.javascript.lcov.reportPaths?

Please review our JavaScript/TypeScript Test Coverage | SonarCloud Docs for more information.

If that still doesn’t help, please get debug logs (sonar.verbose=true analysis parameter) and attach them here.

Hi Joe , thanks for getting back to me!

No lcov report seems to be generated at all, despite the jest.config.js settings. However, a cobertura-coverage.xml file is being generated and published as an artifact.

The sonar scan task seems to be locating the .coverage and .trx files:

To be clear, are you wanting coverage for your C# files only?

If so, can you please attach the full logs?

EDIT: if you prefer, I can send a private message to you to review it.

We definitely want coverage for both the C# and ts files. I’m looking at this portion (sorry, Jest is new to me) - despite setting it in the jest.config.js file it doesn’t appear to ever get generated.

I’d be happy to get any files that would help with this, and a private message would be awesome.