Code coverage in sonar-scanner-cli

Hello you wonderful people!

Our university is currently doing some research with SonarQube but now we are also looking into utilizing it in teaching. The idea is to start scanning student repositories and provide feedback about the code quality. The languages we want to support in the first phase are Python, JavaScript and Java.

We have an on-prem GitLab and on-prem EE SonarQube. The idea is to integrate the dockerized scanner into our GitLab CI and send reports to SonarQube.

First tests with Python looked promising as we got the reports to SQ in just a couple of hours. However there doesn’t seem to be any tooling available in the image to produce coverage reports for Python.

We still haven’t tested Java. JavaScript started to work pretty easily since we have npm available in the image.

If the image contained pip it would probably solve at least our current problem of producing coverage reports for Python.


Welcome to the community, you wonderful person! :smiley:

We just don’t handle/get into that. We expect you to run your build (it’s not required for Python, but you’ll find that it is once you get to Java) and generate coverage reports prior to / outside of analysis & just pass those results in.


Yeah I totally understand that so no worries. I was expecting Java to be way more cumbersome than JS but on the other hand I was hoping that Python would be possible to analyze inside the container.