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
KalluruKalluru 

Average test coverage across all Apex Classes and Triggers at least 75% test coverage is required.

Hi I am trying to deploy one class in production from sanbox in sanbox it showing as 88% coverage in production I am getting fallowing error. Average test coverage across all Apex Classes and Triggers is 68%, at least 75% test coverage is required. But not telling me which class is not covering can you please help me solving this issue

bob_buzzardbob_buzzard

This implies that the code coverage of your existing classes in production is not high enough.  Its quite easy to break unit tests by adding required fields or validation rules, so it might be something along those lines.

 

If you execute all the tests on your production org you should be able to see which ones have low coverage - you'll have to improve those as part of your deployment I suspect.

KalluruKalluru

Thanks for your reply

But the average cove covered in Production is 88%,

I checked my class most my apex classes in production are 90% covered and

I don't have any validations rules in production which are not in the sanbox.

Thanks,

Oraveen


bob_buzzard wrote:

This implies that the code coverage of your existing classes in production is not high enough.  Its quite easy to break unit tests by adding required fields or validation rules, so it might be something along those lines.

 

If you execute all the tests on your production org you should be able to see which ones have low coverage - you'll have to improve those as part of your deployment I suspect.


 

bob_buzzardbob_buzzard

Hmm.  If production is at 88% but when you introduce your class it drops to 68%, that implies that something about your deployment is dropping the value.  Presumably you are deploying unit tests to cover the class at the same time?  How are you deploying?  Is it change sets, force.com ide?

KalluruKalluru

I am using change set.

 

OpportunityLineItemWrapper------------ Apex Class -100%
RedirectSalesOrderPage ----------------Vocabularies Page 
SalesOrder -----------------------------------Visualforce Page 
UnitTestUtil -----------------------------------Apex Class--100%

ZuoraHelper---------------------------------- Apex Class--80%

ZuoraProductRatePlanWrapper -------Apex Class -100%
partnerPortalSubscription -----------------Visualforce Page 
partnerPortalSubscriptionController -----Apex Class --82%
partnerPortalSubscriptionControllerTest- Apex Class 
zuoraProductRatePlanChargeWrapper---Apex Class-100%

 

partnerPortalSubscriptionControllerTest is test class it covering in sanbox

 

When I am trying to deploy in production I am getting falowing error.

 

Average test coverage across all Apex Classes and Triggers is 68%, at least 75% test coverage is required.

 

Thanks,

Praveen

 

 

 

 

 

 

bob_buzzardbob_buzzard

If you view the results of the change set, do you see any failure reasons in there?

KalluruKalluru

I don't have any failures but I do have some class called zSchema(38%) and zObject(16%) but these classes are API given by app called Zuora.I can't see the source code and I can't write a test methods to cover.

 

Part of my test methods I skipped a few lines of code in a class called Zuorahelper because it got callout method in it but I can't skip the lines in witch I am building the request using Zobject API.

 

Beacuse of these 2 classes zSchema(38%) and zObject(16%) my coverage comes to 42%.



Average test coverage across all Apex Classes and Triggers is 42%, at least 75% test coverage is required.

 

 

 

 

 

 

 

bob_buzzardbob_buzzard

That's a bit of a tough one.  I'm not sure what you can do if a managed package doesn't have coverage.  In the past we've had to contact the authors of the package and request that they improve the unit test coverage.

 

Have you tried deploying via the force.com ide?  I'm not convinced it would behave any differently, but it might be worth a shot.

KalluruKalluru

Thanks alot for the replay I am going to contact Package author for test coverage.