We have been getting coverage correctly for most of the PRs.
However, we have a PR that has all analysis results except coverage.
As far as I know, SonarCloud doesn’t enforce coverage conditions when there are fewer than 20 changed lines. The PR has 42 new lines: 33 lines are in a file and 9 are in another file.
Files paths are not in the exclusions.
Can you share a screenshot of the PR’s Code tab, and also your full analysis log?
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.
I’ve looked at the link you shared and then I found the part of the scanners log which is related to coverage:
INFO: Sensor CSS Rules [javascript] (done) | time=206ms
INFO: Sensor JavaScript/TypeScript Coverage [javascript]
INFO: Analysing [/github/workspace/./coverage/lcov.info]
WARN: Invalid character encountered in file /github/workspace/src/assets/Recognyte-Logo-on-white-digital.png at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using the property 'sonar.sourceEncoding'.
WARN: Could not resolve 32 file paths in [/github/workspace/./coverage/lcov.info]
WARN: First unresolved path: src/config/dotEnv.js (Run in DEBUG mode to get full list of unresolved paths)
INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=69ms
We get the same issue in another PR. I’ve just checked its logs and I notice the same warning about UTF-8.
I’d really prefer the full analysis log, redacted as necessary.
What you’re showing, though, is a problem with matching the file paths in the coverage report with the file paths analysis sees. So that’s where you need to start looking.
Also, I believe I see in the upper-right corner of your latest screenshot that there’s a warning on the analysis…?