Replies: 2 comments
-
This way also the coverage output of the |
Beta Was this translation helpful? Give feedback.
-
Think I provided this info to you in some other thread but just reposting in case it may help others. I agree the CLI test commands should be updated to provide the same coverage formats as the deploy command. But I think there's still a fundamental issue with getting either format into external CI/CD tools which depend on matching files in the coverage report to files in the CI/CD repo. I know the "no-map" prefix is hard-coded in the deploy command reports. I don't know if the CLI can currently map apex files to where they exist in a package directory per the sfdx-project.json file. For several reasons, I developed this CLI plugin designed to get coverage reports that can be accepted by external platforms like GitLab, SonarQube, GitHub, etc. https://github.com/mcarvin8/apex-code-coverage-transformer I can update my plugin relatively quickly with new coverage formats if I can reference some baseline. i.e. I can see how the Salesforce deploy command creates a "cobertura" coverage file and re-create it with my plugin. My plugin converts the "json" format available in both deploy and test to different formats. I've heard Salesforce talk about re-evaluating their code coverage functions but I'm not sure how long that's going to take and the scope of that work. So I'll let them respond regarding the effort to at least port the coverage formats from the deploy into test command. But they did confirm that those are 2 separate code bases which explains why they follow different formats. If you create a JSON with both commands, you'll see them with different structures. |
Beta Was this translation helpful? Give feedback.
-
Recently the command
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm#cli_reference_project_deploy_start_unifiedsf project deploy start
has gained capability to report coverage in different formats:Options available for
--coverage-formatters
:✨ This feature request is about making this also available for the following commands:
sf apex run test
sf apex get test
Beta Was this translation helpful? Give feedback.
All reactions