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
Admin Admin 31Admin Admin 31 

Error while deploying change set with barely any code changed.

We are trying to deploy to production environment and it always says that we have a low coverage of code,regardless of anything we try to deploy.

We tried different types of change sets:
1. A change sets with our changes. It didn´t work.
2. A change set with test classes in order to increase coverage. It didn´t work.
3. A change set with a class, changing ONLY Strings and nothing else(accents in some words). It didn´t work.

Before deploying, the code coverage is 80%. The error while deploying says that the code coverage is 73-74% which means that by changing a few Strings in a class, we decrease our coverage by 6%??? It doesn´t make sense.
PratikPratik (Salesforce Developers) 
Hi Admin,

Will you please try to do "Run All Test" in both Sandbox and Production environment and then check the test coverage for both before deployment

Thanks,
Pratik
Admin Admin 31Admin Admin 31

Hi Pratik,
It is 79% for sandbox and 80% for production. 
We did a little experiment today:

We refreshed a new sandbox, meaning it has everything exactly the same as production environment, and then we created and deployed a new change set with one single and unmodified class!!! and yet it failed.....low code coverage again... *sigh*

This is frustrating.....and salesforce refuses to help because we are not premium customers  nor partners....

PratikPratik (Salesforce Developers) 
Hi Admin,

Now create a custom field on any object in sandbox and then creat a new changeset and add only the custom field and then upload it to Prod. Try to validate and deploy this changeset in Prod and let us know how it goes.

Thanks,
Pratik
Admin Admin 31Admin Admin 31
Hi Pratik,
We just did that and it failed...again :'(
I really don´t know what is going on...
 
PratikPratik (Salesforce Developers) 
Hi Admin,

This time what error it's showing?

Thanks,
Pratik