Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-345

[Apex] Allow the import of Salesforce DX projects test coverage reports

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: Coverage
    • Labels:
      None

      Description

      A test code coverage report can be generated for Apex using Apex CLI with the 'force:apex:test:run' command.

      To generate a report locally, it is required to have a Salesforce DX Project linked to your Salesforce Org.

      An easy way to do/test this can be done by following instructions on this github simple test project.

      Once the project is setup, running the following command sfdx force:apex:test:run -c -d . -r json --wait 4 will generate a JSON coverage report test-result-codecoverage.json. See attachment to see the format of such reports.

      Allow sonar-apex to import these reports by adding a sonar.apex.coverage.reportPath property to read such files.

        Attachments

          Activity

            People

            • Assignee:
              christophe.zurn Christophe Zurn
              Reporter:
              christophe.zurn Christophe Zurn
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: