You need to sign in to do that
Don't have an account?
Samerg
code coverage 0% when deploying new inbound changeset
Hi,
I am deploying a new inbound changeset and I got an error that I have 0% coe coverage.
What does this mean? note that I am choosing default option.
is it running only the tests that are included in the inbound changeset? or all tests related to the changes I am deploying.
It's a bit confusing.
Thanks,
samerg
I am deploying a new inbound changeset and I got an error that I have 0% coe coverage.
What does this mean? note that I am choosing default option.
is it running only the tests that are included in the inbound changeset? or all tests related to the changes I am deploying.
It's a bit confusing.
Thanks,
samerg
Answer to the first query - If your changeset contains trigger A, Classes B and C, you need to create test classes for trigger A (atleast 1% code-coverage required), test classes for B and C (atleast 75% is required).
Answer to the second query - If the class is disabled, you need not to create test class.
All Answers
From Salesforce articles:
When a change set is deployed to a production org, all local Apex tests in that org are run by default if you’re deploying any Apex classes or triggers. If the target org is a sandbox, however, tests aren’t automatically run.
So, if you have chosen default, all tests are run, except the ones that originate from managed packages. If your package doesn’t contain Apex components, no tests are run.
Regards
Andrew
If your changeset is containing Apex class/trigger, try deploying your it using the last option - Run specified tests and add the test class of your component (classes/triggers), if still it is giving 0% code coverage, it might be due to --
1. some settings that you used in Sandbox while creating testsetup data or running test sceanrio (test methods) is not the same in prod.
2. some previous class, alraedy present in prod, has been modified which is failing.
In any of the cases, you will get the list of reasons that is causing this error.
In the list of specific tests, I should put all the tests related to the classes and triggers in the changeset?
Thanks,
Samer
samer
Answer to the first query - If your changeset contains trigger A, Classes B and C, you need to create test classes for trigger A (atleast 1% code-coverage required), test classes for B and C (atleast 75% is required).
Answer to the second query - If the class is disabled, you need not to create test class.