0

Can any one help me out. Based on the requirement written a trigger on case and casecomment object.

The outbound changeset went well while uploading but in Inbound changeset was un successful. At the time of Validation in change set i got an Error on

Code Coverage Failure   :
Your organization's code coverage is 74%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.
ReparentComment.

Error Message :

Details: Average test coverage across all Apex Classes and Triggers is 74%, at least 75% test coverage is required.
ReparentComment, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

I shall appreciate your help.

1

Salesforce is a multi-tenant system that uses test coverage to help protect the overall system.

At least 75% of your total apex code must be covered with unit tests, although you will make life easier for yourself if you aim for 85% or 90%.

You have added code, which when deployed to the target organisation, leaves the target organisation's code coverage below the threshold so the changeset can't be applied.

See the Salesforce help doc for more info: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_deploying_ant_deploy.htm

At least 75% of your Apex code must be covered by unit tests, and all of those tests must complete successfully.

Note the following.

When deploying to a production organization, every unit test in your organization namespace is executed.

  1. Calls to System.debug are not counted as part of Apex code coverage.

  2. Test methods and test classes are not counted as part of Apex code coverage.

  3. While only 75% of your Apex code must be covered by tests, your focus shouldn't be on the percentage of code that is covered. Instead, you should make sure that every use case of your application is covered, including positive and negative cases, as well as bulk and single records. This should lead to 75% or more of your code being covered by unit tests.

  4. Every trigger must have some test coverage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.