0

I am looking for a full list of metadata types that I can deploy to Production without test classes.

  • Flows (Not Sure)
  • Apex Classes (Required)
  • Custom Fields (Not required)
  • Etc.

I have searched the salesforce documentation for metadata requirement clarifications, but have not been able to find an official list.

Is there an official list of metadata types that do and do not require code coverage upon deployment?

2 Answers 2

2

It depends on version of Metadata API. If Your metadata API version is less than 34 . Please find the article for the same

If the deployment includes components for the following metadata types, all local tests are run.

ApexClass
ApexComponent
ApexPage
ApexTrigger
ArticleType
BaseSharingRule
CriteriaBasedSharingRule
CustomDataType
CustomField
CustomObject
DataCategoryGroup
Flow
InstalledPackage
NamedFilter
OwnerSharingRule
PermissionSet
Profile
Queue
RecordType
RemoteSiteSetting
Role
SharingReason
Territory
Validation Rules
Workflow

If Metadata API version is greater than 34.

When deploying to production, all tests, except those that originate from managed packages, are executed if your deployment package contains Apex classes or triggers. If your package doesn’t contain Apex components, no tests are run by default.
6
  • Are record Triggered Workflows lumped into "Apex Triggers"? Mar 31, 2022 at 13:55
  • I don't think flows required test class for deployment to production Mar 31, 2022 at 13:56
  • I just tried deploying a record triggered flow. This executed all the test classes in the organization. Mar 31, 2022 at 14:05
  • I also just tested this with Autolaunched Flow (No Trigger) and it triggered ALL Tests in production. Mar 31, 2022 at 14:14
  • I hope we have some known issue may be related to it trailblazer.salesforce.com/… Can you check if this is related Mar 31, 2022 at 14:23
0

Default Test Execution in Production

When no test level is specified in the deployment options, the default test execution behavior depends on the contents of your deployment package. When deploying to production, all tests, except those that originate from managed packages, are executed if your deployment package contains Apex classes or triggers. If your package doesn’t contain Apex components, no tests are run by default.

In API version 33.0 and earlier, tests were run for components that required tests, such as custom objects, and not only for Apex components. For example, if your package contains a custom object, all tests are run in API version 33.0 and earlier. In contrast, starting with API version 34.0, no tests are run for this package. The API version corresponds to the version of your API client or the version of the tool you’re using (Ant Migration Tool).

You can run tests for a deployment of non-Apex components. You can override the default test execution behavior by setting the test level in your deployment options. Test levels are enforced regardless of the types of components present in your deployment package. We recommend that you run all local tests in your development environment, such as sandbox, before deploying to production. Running tests in your development environment reduces the number of tests needed to run in a production deployment.

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .