We are running our pipeline in gitab, where each test projects runs the code coverage and store it in gitlab artifact.
At the last step we run the sonar scanner, where code is analyzed and code coverage is imported.
In the pipeline log, we see that our code coverage files are all imported and added to cache, but not all codecoveage is available when looking into sonarcloud.
SurveyApi has zero coverage in sonarcloud, but the pipeline log for test shows 71%
The sonarscanner pipeline shows that the coverage log is imported OK.
We uses coverlet->OpenCover code coverage.
Any ideas what is wrong ?
INFO: Parsing the OpenCover report /builds/HUzDdLgV/0/[MASKED]/glyngore/glyngore-context/testCoverage/./SurveyApiTestResult.xml
INFO: Adding this code coverage report to the cache for later reuse: /builds/HUzDdLgV/0/[MASKED]/glyngore/glyngore-context/testCoverage/./SurveyApiTestResult.xml
Setting sonar.verbose=true should give you some additional logging about what’s found in the coverage report.
Considering you have 793 files indexed in your project but only 181 files are found with coverage data, it seems some information could be missing from the report.
INFO: 793 files indexed
....
INFO: Coverage Report Statistics: 186 files, 181 main files, 181 main files with coverage, 5 test files, 0 project excluded files, 0 other language files.
I would also suggest simply running the equivalent of a cat /builds/HUzDdLgV/0/[MASKED]/glyngore/glyngore-context/testCoverage/./SurveyApiTestResult.xml to make sure it really contains the coverage data you expect (regardless of what the previous console output says).