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

Test Coverage 72% in IDE, 0% using Migration Tool
Hello,
I thought I'd seen reference to this in previous posts, but I can't seem to find any thing when I search.
When I run all tests in the SF web interface, I get 72% test coverage. When I attempt to deploy with the migration tool, I get a message like this:
Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
After running the test In the web interface, I see the test methods for both triggers listed under Test Success, and I can see debug output from the triggers in the test log.
Is there some xml I need to add to build.xml to specify the test methods for triggers? Maybe I'm doing something else wrong?
Here is one of the trigger test methods:
Thanks.
joe
I thought I'd seen reference to this in previous posts, but I can't seem to find any thing when I search.
When I run all tests in the SF web interface, I get 72% test coverage. When I attempt to deploy with the migration tool, I get a message like this:
Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
After running the test In the web interface, I see the test methods for both triggers listed under Test Success, and I can see debug output from the triggers in the test log.
Is there some xml I need to add to build.xml to specify the test methods for triggers? Maybe I'm doing something else wrong?
Here is one of the trigger test methods:
Code:
public class TestTriggers { public static testMethod void testChatTrigger() { isp__Chat__c chat = new isp__Chat__c(); //isp__email__c='fred@bedrock.gov'); chat.isp__email__c ='fred@bedrock.gov'; chat.isp__Last_Name__c = 'Flinstone'; chat.isp__first_name__c = 'Fred'; chat.isp__phone__c = '99955512121'; // get Account, Contact to set chat references Account[] aa = [select id from Account]; if (aa.size() > 0) { chat.isp__account__c = aa[0].id; } Contact[] cc = [select id, account.id from Contact]; if (cc.size() > 0) { chat.isp__contact__c = cc[0].id; } insert chat; System.debug('NEW CHAT ID= ' + chat.id);
System.assert(chat.id != null);
} }
Thanks.
joe
Also, what does your package.xml file look like?
Tests Run: 2
Test Failures: 0
Code Coverage: 93
Under Test Success I see both testChatTrigger() and testMailTrigger()
No errors in debug log.
package.xml:
Thanks for the reply
When I run the migration tool with the same code against an existing client's org that has installed packages, the migration tool reports 42% code coverage. I get the same result using the Eclipse Force.com deployment tool. In Eclipse, under the "Code Coverage Results" I can see classes of the installed package listed as having very little code coverage.
So, my question is: how do I deploy an application without having to test all code in installed packages?
Thanks.