Code Coverage for python code running in AWS CodeBuild

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

Sonarqube version: 7.7

we are running build in AWSCodeBuild by using docker, and we were able to get sonarscanner run on code. and we see analysis in Sonarqube. now we are trying to achieve “CodeCoverage”, we had used pytest to get coverage.xml file. but if we trying to import that xml in sonarqube, we are getting below errors:
Cannot resolve the file path ‘’ of the coverage report, the file does not exist in all .
and many other issues.

i am not able to attach xml file since its not supporting. please let us know how we can import coverage xml to sonarqube, and how can we get coverage in sonarqube.

please give us suggestions.



Please provide full logs of analysis in debug mode and the report coverage.xml (you can do it simply copy pasting in the message inside 3 backticks, like code).

Coverage.txt (2.1 MB) Sonar-Scanner_Log.txt (234.0 KB)

I am attaching logs,

  1. sonar scanner log
  2. coverage report

I am trying to add xml in quotes, but lines are more so I can’t add . so I am attaching as txt file

Are you sure it’s the right log? there is no error message you mentioned above, and these is no even python files

2018-11-14T15:51:21.2428467Z 10:51:21.242 DEBUG: 'Python Squid Sensor' skipped because there is no related file in current project

this was initial steps its showing:

INFO: ------------- Run sensors on module SDC-vulcan-Sonar
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=28ms
INFO: Sensor Python Squid Sensor [python]
INFO: Sensor Python Squid Sensor [python] (done) | time=83304ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Python test coverage
INFO: Parsing report ‘/codebuild/output/src645256304/src/’
ERROR: Cannot resolve the file path ‘’ of the coverage report, ambiguity, the file exists in several
ERROR: Cannot resolve 13 file paths, ignoring coverage measures for those files
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=323ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=99ms
INFO: Sensor SonarCSS Metrics [cssfamily]
INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=883ms
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=4842ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=20ms
INFO: Sensor SonarJS [javascript]
INFO: 360 source files to be analyzed
INFO: 130/360 files analyzed, current file: smilecheck/sites/staff/static/staff/components/tests/components/case_details/aligner-pre-order/APOAddressMixin.spec.js
INFO: Sensor SonarJS [javascript] (done) | time=15105ms

is there a chance to connect us through any screen sharing app and resolve this ?

According to your logs only 13 python files of the entire project will not have coverage.
This is because for these 13 files our coverage report parser is not able to unambiguously define actual file on the disk, there are several of them which match the relative path in the report.

See if you could produce absolute paths in these report or may be produce several reports for different directories.