SonarQube: Enterprise Edition Version 7.8 (build 26217)
SonarScanner: 3.3.0 and 4.4.0
I am trying to get coverage percent on new code for Github PR builds and have tried several combinations of settings to the java sonar scanner tool via the jenkins plugin.
Here’s the command:
/Users/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube_Scanner_4.4.0/bin/sonar-scanner -Dsonar.projectVersion=88.0.0 -Dsonar.host.url=**** -Dsonar.login=**** -Dsonar.cfamily.threads=6 -Dsonar.pullrequest.github.repository=org/repo -Dsonar.pullrequest.key=3249 -Dsonar.github.pullRequest=3249 -Dsonar.pullrequest.branch=branch_to_merge_to_master -Dsonar.pullrequest.base=master -Dsonar.scm.revision=e5954ebe07b031b9dcb55477a6c25f1174597a8c
I see this in the log:
INFO: SCM provider for this project is: git
INFO: 9 files to be analyzed
INFO: 9/9 files analyzed
And those are the nine non ignored files modified in the PR, two of which are completely new swift file, which is correct.
Looking at the PR, I see those nine files listed in the code header with what seems like accurate coverage information. The two new files are 100% covered based on the green bars on the left side when I open up the code viewer.
But when I look at the summary page its showing ‘—Coverage on 0 New Lines to cover’ and the code file browser shows no coverage data on it. Attached two screenshots with sensitive info cropped