2

Is there a way to retrieve the overall test coverage of an org using Salesforce DX? I understand there is a way to get the coverage for individual classes using the -c flag, but was looking specifically for the entire org's coverage. Is this type of information accessible through the metadata?

2

It's not included in the apex: test commands, but I found that using a SOQL query and specifying the use of the tooling API works.

sfdx force:data:soql:query --query "SELECT PercentCovered FROM ApexOrgWideCoverage" --usetoolingapi

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.