+ Start a Discussion
CTU007CTU007 

ant deploy code question: will it test all classes in the production?

Hi, I have installed the "Sidebar Summary" and it works great.
 
But now when I tried to deploy another class, it says:
 

Test Class VFController_Sidebar_Summary
Tests Run 1
Test Failures 1
Code coverage total % 100
Total time (ms) 0

Class VFController_Sidebar_Summary testVFController_Sidebar_Summary 136 System.Exception: Too many query rows: 501 Class.VFController_Sidebar_Summary.getPastDueOppty: line 52, column 8
Class.VFController_Sidebar_Summary.testVFController_Sidebar_Summary: line 68, column 14

This test calss is not in the "package.xml” file. So why it runs this test? Not the one I specified in "package.xml"? Should they be independent?

 

 

Best Answer chosen by Admin (Salesforce Developers) 
hemmhemm

When you deploy code, it runs All Tests.  Can't get around that.

 

That's not your issue, though.  To fix your issue, edit the main controller for Sidebar Summary and add limit 1000 to the end of each query.  Apex has a limit of 1000 records that can be returned.  Even though it's doing a count(), it still hits this limit.  What is happening is that it all works great in Test where there's little data, but when it hits your Production system, the record counts are too high.

 

Vote/comment on this idea to not have the count() SOQL function work this was in Apex code.

Message Edited by hemm on 01-28-2009 11:21 PM

All Answers

sdudasduda
Yes, when deploying to production all test methods must pass and have at least 75% code coverage.

There's no way to get around this - every class on your production enviroment must pass.


Message Edited by sduda on 12-16-2008 08:40 AM
hemmhemm

When you deploy code, it runs All Tests.  Can't get around that.

 

That's not your issue, though.  To fix your issue, edit the main controller for Sidebar Summary and add limit 1000 to the end of each query.  Apex has a limit of 1000 records that can be returned.  Even though it's doing a count(), it still hits this limit.  What is happening is that it all works great in Test where there's little data, but when it hits your Production system, the record counts are too high.

 

Vote/comment on this idea to not have the count() SOQL function work this was in Apex code.

Message Edited by hemm on 01-28-2009 11:21 PM
This was selected as the best answer