we have some problems with code coverage. Our Projet has an XUnit Test Project which will also run in the pipeline. The code coverage is recognized in the azure pipeline and reported there. But not on our SonarQube server. There is always 0.0%.
Problen and solution found. Within the logs of the analyser I found following warning:
2024-02-28T19:31:31.9309938Z INFO: Parsing the OpenCover report /home/vsts/work/_temp/623816fd-d37e-47e5-a1c5-e401327bc55f/coverage.cobertura.xml
2024-02-28T19:31:31.9310709Z WARN: Could not import coverage report '/home/vsts/work/_temp/623816fd-d37e-47e5-a1c5-e401327bc55f/coverage.cobertura.xml' because 'Missing root element <CoverageSession> in /home/vsts/work/_temp/623816fd-d37e-47e5-a1c5-e401327bc55f/coverage.cobertura.xml at line 2'.
Due to this error, I changed the format from Cobertura to OpenCover