2

In our org we have setup SonarQube with codescan. The build is triggered through a Jenkins job.

Now we are struggling to get data from the coverage. eventhough we are setting the resultformat to json in sfdx force:apex:test:run My output directory is named coverage in my sonar-project.properties I have mentioned the directory to the test-result-codecoverage.json.

sonar.language=Apex
sonar.projectBaseDir=.
sonar.apex.coverage.reportPath=coverage/test-result-codecoverage.json

But in some way the coverage value is always 0. Does someone know how sonarqube can parse my unit test report from sfdx.

2
  • Salesforce DX does not output a standard format like Cobertura or Lcov. Have you confirmed that with your vendor that SonarQube supports SFDX's unique coverage format?
    – David Reed
    Jun 15, 2020 at 18:31
  • @DavidReed I have confirmed SonarQube supports sfdx format (json) out of the box. It seems that sonarqube can't access the directory I made for the test coverage
    – RomeoRomeo
    Jun 15, 2020 at 18:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.