== See duplicate post: https://salesforce.stackexchange.com/posts/76899/edit ==
I'm happy to report that as of Summer '15 (v34.0) there is now a testLevel parameter on the sf:deploy command so if you're using the Summer '15 version of ant-salesforce.jar you can now specify:
<target name="deployCodeCheckOnly">
<sf:deploy
testLevel="RunLocalTests"
username="[email protected]"
password="password"
serverurl="https://test.salesforce.com"
maxPoll="500"
deployRoot="codepkg"
checkOnly="true"/>
</target>
This will specifically exclude any Managed Package tests from running. There are a number of other changes to the test options for deployments in Summer '15 that you can read about here.
The available testLevel options are:
- NoTestRun—No tests are run. This test level applies only to deployments to development
environments, such as sandbox, Developer Edition, or trial
organizations. This test level is the default for development
environments.
- RunSpecifiedTests—Only the tests that you specify in
the runTests option are run. Code coverage requirements differ from
the default coverage requirements when using this test level. Each
class and trigger in the deployment package must be covered by the
executed tests for a minimum of 75% code coverage. This coverage is
computed for each class and trigger individually and is different
than the overall coverage percentage.
- RunLocalTests—All tests in your
organization are run, except the ones that originate from installed
managed packages. This test level is the default for production
deployments.
- RunAllTestsInOrg—All tests are run. The tests include
all tests in your organization, including tests of managed packages
See the [Force.com Migration Tool documentation][1]