I am preparing an Ant package to move code to production. However, many of the existing orgs tests are very out of date and are failing. At this point, my only option is to select tests that cover the code that I'm deploying since I cannot fix all of the tests before going to production.

Is there a way using migration tool to enforce production-like test coverage rules without running all tests? My challenge is ensuring that the tests I manually select to run on deploy adequately cover the classes I am deploying.

1 Answer 1


To simulate the default behavior of production, use:

<sf:deploy testLevel="RunLocalTests" ... />

This will run all tests in your org's namespace, but not those from installed packages. You can read more about it in Deploying Changes to a Salesforce Org.

You must log in to answer this question.

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