You need to sign in to do that
Don't have an account?
Janno Rip
Estimated Code Coverage 82% but Deployment fails with 73%
Hello everyone,
I am a total newbie when it comes to apex test classes and code coverage. I took over an org where a lot of customizing was done. When i hit "Estimate your organization's code covearge" it says:
Before that I was running tests on all our test classes.
Now I've build something on our sandbox and tried to deploy it. But I am getting the following error:
Are these two different things?
What can i do to get more than 73%? Write test classes for existing apex classes?
Thanks in Advance
Jan
In production orgs, a new setting lets you deploy a new active version of a process or flow via change sets or Metadata API. This setting doesn't appear in non-production orgs (such as scratch, sandbox, and developer orgs), because you can always deploy a new active version.
When you deploy an active process or flow in a production org, Salesforce runs your org’s Apex tests and confirms that enough of your processes and flows have test coverage. Specifically, the Apex tests must launch at least 75% of the total number of active processes and active autolaunched flows in your org.
Spring '19 (https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_forcecom_flow_test_coverage.htm) introduces some enhancements to how you can test processes and flows, and also allows you to track coverage more easily:
If your org uses Apex tests to validate processes and autolaunched flows, you’re probably interested in knowing what your flow test coverage is. We’re introducing two Tooling API objects that you can query to calculate test coverage for processes and autolaunched flows.
If you're not using the new tool to deploy Flows as active, you don't need to worry about coverage level.
My best suggestion which I recently tried is deploy processes/flow by making it inactive
Please vote if you find this as best answer!!
All Answers
In production orgs, a new setting lets you deploy a new active version of a process or flow via change sets or Metadata API. This setting doesn't appear in non-production orgs (such as scratch, sandbox, and developer orgs), because you can always deploy a new active version.
When you deploy an active process or flow in a production org, Salesforce runs your org’s Apex tests and confirms that enough of your processes and flows have test coverage. Specifically, the Apex tests must launch at least 75% of the total number of active processes and active autolaunched flows in your org.
Spring '19 (https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_forcecom_flow_test_coverage.htm) introduces some enhancements to how you can test processes and flows, and also allows you to track coverage more easily:
If your org uses Apex tests to validate processes and autolaunched flows, you’re probably interested in knowing what your flow test coverage is. We’re introducing two Tooling API objects that you can query to calculate test coverage for processes and autolaunched flows.
If you're not using the new tool to deploy Flows as active, you don't need to worry about coverage level.
My best suggestion which I recently tried is deploy processes/flow by making it inactive
Please vote if you find this as best answer!!
thanks for your reply. In the end I managed to achieve the deployment. I still had 1 Apex Error that I could not fix so far - until i did. After deactiviting some process / Flows - checking/unchecking the checkbox wheter new process/flows should be inactive or active the error message disappeared.
Greetings