I'm trying to deploy a change set to Prod but I get the following error: Average test coverage across all Apex Classes and Triggers is 67%, at least 75% test coverage is required. My change set only includes some custom fields, a page layout and a record type. I'm not sure why I'm getting this error or how to resolve it. Any assistance would be appreciated.
Attribution to: user7417
Possible Suggestion/Solution #1
Apex Tests get executed every time you perform a deployment. Therefore you will need to create the tests.
Using a tool like Copado Deployer instead of Change Sets can help you analyse such problems when performing deployments. The app available on the appExchange can be used for free (it's also much quicker than change sets). https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B3dgGEAR
I had a friend email the developers at Copado who help with writing some apex tests, you can try to reach out to them (www.copa.do).
Otherwise check out the documentation here: https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
Attribution to: Philipp Rackwitz
Possible Suggestion/Solution #2
This is documented. You will need to increase the code coverage by creating or improving your test classes.
If the deployment includes components for any of the following metadata types, all the tests are automatically run. ...
- CustomField
- CustomObject
- ...
...
http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_deploy_running_tests.htm
Attribution to: PepeFloyd
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/32794