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
vlotarevvlotarev 

How to switch off test coverage checking?

Does anybody know whether is it possible to switch off that annoying test coverage checking (at least for sandbox)? I understand that test driven development is a good thing and so on and so for ... But writing tests take time that sometimes I don't want to loose.

Novo_ArtisNovo_Artis

You cannot turn it off due to the nature of the salesforce platform.
At first it can be a real pain the a** but it is well worth it in the long run. (When I started writing apex code I came into the forum and asked the very same question)

 

It's my understanding that sandbox won't stop you from saving and executing triggers/classes but it will still notify you of your coverage status.

incuGuSincuGuS

Code coverage percentage is needed to deploy to production.

If you are coding in sandbox it shouldnt bother you , when you are ready to deploy take your time to write test methods, you will find thats sometimes its a good way of reviewing your code and optimizing it also. ( you have to see the bright side of things :) )

 

Other than that, as Novo_Artis says,  it can't be turned off. It necessary to check that you have tested your code and its working before going into production.

 

If you are really worried about time , there are workarounds.

 

Create a method that has :

 

 

Integer i;

i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;i++;... 
  •  THIS IS A WORKAROUND NOT A SOLUTION!!!

 

 

a lot of times, and just write a test method that calls that method.

It will ensure new code coverage.

 

Hope this helps you out if you are facing hard deadlines,

Gaston.

WesNolte__cWesNolte__c

Hey

 

I hate to be preachy but if you don't spend time testing now, you're going to have to spend more time fixing bugs later, and probably under more pressure.

 

Wes

vlotarevvlotarev

But agree that if you are just evaluating the platform and is writing the sample code that will never be deployed to production writing of test code is just wasting of time ...

WesNolte__cWesNolte__c

Yip. But how would the test coverage limit get in your way if you're not deploying to live? Are you building your code using the ant scripts?

 

Wes

vlotarevvlotarev

No. I use Force.IDE. Initialy I used production free developer force environment and that test coverage problem prohibits me from deploying my sample application. Now I am working in sandbox and code is deployed fine though this annoying error message is still here ...

WesNolte__cWesNolte__c

You could just not deploy the code and instead change the credentials of the project and push the code up to the Org e.g. you have an eclipse project that is using the username and password for the developer org, change the username and password to that of your sandbox and 'Save to server'.

 

Wes