Code Coverage quality gate for Salesforce

I am using Jenkins to trigger build on GitHub pull requests for SonarQube analysis with CodeScan plugin for Salesforce.
I have setup the quality gates with Code Coverage error out if below 95%. But when any analysis runs, the code coverage is not shown for any of the apex class files.

My setup
Jenkins Parameter for sonarqube
sonar.branch.name
sonar.project = Salesforce

Sonarqube
Setup a project ‘Salesforce’ and quality gates and quality profile for the ruleset I require.

The job is giving errors based on rulesets, but I need to know the code coverage also which is not happening. What should be the correct setup?

Hi,

For Salesforce, I guess you mean Apex? If so, this should help: https://docs.sonarqube.org/display/PLUG/Apex+Coverage+Results+Import

 
Ann

1 Like

Hi @ganncamp,

We are too facing similar issue, we are using azure devops as a part of ALM, and we were able to get the code coverage for other languages but for Apex we are unable to do so.
In documentation executing the code coverage is given for SFDX project, but right now we are using SFDC(non SFDX project).

Could you provide us the documentation page or help us understand on how to retrieving the code coverage for SDFC project.

Thanks,
Abhishek

https://docs.sonarqube.org/display/PLUG/Apex+Coverage+Results+Import

This URL is not working, can you pls share the relevant url for above topic: Apex+Coverage+Results+Import

Thanks for your time.

Try this @Bala: