I am currently implementing an azure DevOps pipeline for my .Net microservices.
I researched and read the sonar cloud doc, but nothing helped yet. I did generate the code coverage report using cobertura and that is working correctly in azure devops but I found out that you cannot link that type of format to sonarcloud so I was trying somehow to generate also the opencover and use it for exporting to sonarcloud, this is what I have done so far:
This is the core problem, since you can’t have coverage of tests.
Can you share your analysis logs?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
14:22:12.994 DEBUG: The current user dir is '/home/vsts/work/1'.
14:22:12.995 INFO: Parsing the OpenCover report /home/vsts/work/_temp/_fv-az632-167_2023-01-11_14_20_13/In/fv-az632-167/coverage.opencover.xml
14:22:13.034 DEBUG: Did not find deterministic source path in '/home/vsts/work/1/s/Authorization/Class.cs'. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
14:22:13.036 DEBUG: CoveredFile created: (ID '1', path '/home/vsts/work/1/s/Authorization/Class.cs', NO INDEXED PATH).
14:22:15.648 DEBUG: Skipping the file (ID '6', path '/home/vsts/work/1/s/Authorization/Class.cs', NO INDEXED PATH), line '13', visitCount '0' because file is not indexed or does not have the supported language.
...
14:22:15.680 DEBUG: Analyzing coverage after aggregate found '0' coverage files.
14:22:15.680 DEBUG: The total number of file count statistics is '0'.
Since your source code (versus tests) isn’t being detected, I’m not terribly interested in the detection / parsing of your coverage report. As I stated earlier, without source files, it’s quite natural that you don’t have any coverage since you can’t have coverage of tests.
How can I send u the logs privately somehow, cuz I just cannot show it here.
What could cause that the coverage is only taking the test projects, do you have any idea?