You need to sign in to do that
Don't have an account?

Average Test Coverage Error in Force.com IDE
I'm using Eclipse to develop Apex code. I was working on a pretty big controller directly in my production account (I know, I know...) and got a little behind on implementing the test routines. Eventually the controller would no longer save to my server since the average test coverage dropped below 75%. I was seeing this error in the 'Problems' window in Eclipse:
'Average test coverage across all Apex Classes and Triggers is 74%, at least 75% test coverage is required'
I immediately stopped working on the controller and went back to implement test routines in this and a couple of the other controllers. Now the controller will save but the error message persists even if I run tests from within Eclipse. When I run tests directly in the UI I'm told the average coverage is 84%.
How can I 'clear' the error message from the Eclipse 'Problems' window?
This happens frequently when the error messages get "stuck" in Eclipse. You should be able to close the project and then restart Eclipse and it should clear out.
In the worst case you can delete the project from Eclipse and then recreate it again.
HTH
Jeff Douglas
Appirio, Inc.
http://blog.jeffdouglas.com
All Answers
This happens frequently when the error messages get "stuck" in Eclipse. You should be able to close the project and then restart Eclipse and it should clear out.
In the worst case you can delete the project from Eclipse and then recreate it again.
HTH
Jeff Douglas
Appirio, Inc.
http://blog.jeffdouglas.com
I had already closed and reopened Eclipse many times but the error remained.
I hadn't thought of deleting the project and reloading. That took care of it.
Quite a clumsy solution but it worked. Thanks for your very quick reply.
I'm having the same problem with Eclipse 3.4.2 and v17 Force.com IDE.
91% test coverage in Salesforce, but stuck on 68% in IDE even after shutdown/restart.
Do I really need to wipe out and reload the project? Ouch
I have a related question: my friend and I are doing some consulting work and have been given access to our customer's sandbox, but not their production environment. We wrote a unit test, but the only way I know to see what code coverage percentage is to deploy to production. Is there another way?
Thanks!
I tried "Refresh to Server", "Save to Server", and "Synchronize"... none of which worked.
Deleting the project and re-importing is the only way to clear the error and resume work.
I was consistently introducing an error in unit tests that called a controller method that returns a PageReference, however I didn't have an LValue to reference the return value (didn't think I needed it. Always returns null).
//Compiler throws ambiguous errormyController.PageEventHandler();//FixedPageReference ref = myController.PageEventHandler();
It is at this point that test coverage falls below 75% and starts warning. Adding a PageReference LValue to the test fixes the error, saves to server, and running tests in SForce indicate coverage is above 75%, however Eclipse stays stuck at < 75%.
I suppose incremental code/test is the way around this bug, but it sure cramps my style :-) I prefer to rapidly prototype in a Dev org without tests, then promote code to production if I'm happy with it.
Similar problem here with eclipse 3.52 - code coverage results change each time I run all tests from the IDE. On top of that I get different tests failing just by restarting the IDE. Seems incredibly buggy. Code completion in Eclipse is pitiful as well.
Are there any other IDE's out there that work better for Force.com development, because this one stinks.