function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vijaya Lakshmi 187Vijaya Lakshmi 187 

experiencing code coverage errors when trying to deploy

The actual code coverage of the class is 85 but when I try to deploy it with the migration tool it is throwing the error as the code coverage is 52%.
Best Answer chosen by Vijaya Lakshmi 187
ShirishaShirisha (Salesforce Developers) 
Hi,

Greetings!

If you are trying to deploy single apex class then you can simply use RunSpecifiedTests by using the Specific Test class to deploy successfully since it has more than 75% of code coverage.

Also,I would suggest you to improve the overall code coverage to avoid issue in the future.So that you can use RunLocalTests without any issues.

Reference:https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_deploy_run_specific_tests.htm

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri