3

My Namespace : Only local classes that aren't from managed packages appear in the list

All Namespace: All the classes in the organization appear, whether or not they are from a managed package.

I have few questions on Run All Test Class

  • If we deploy the code to production will it only run mynamespace test classes or All namespace test classes ?

  • If we run all test classes in developer console will it run mynamespace test classes or All namespace test classes ?

0

Depending on the flag you set on your target you will end up running all the test classes in your organization (including the managed ones). We ended having lots of problems with this in our company. The solution we are using is to specify inside the target which test classes will be run in the validation/deployment.

For this, you will have to set the property testLevel in the target to RunSpecifiedTests, and then, inside the tag, specify which tests using the runTest tag.

This is an example of target that does a validation, but won't deploy the code to the org:

<sf:deploy username="<yourusername>" password="<yourpasswordandtoken" serverurl="<urlofyourorg>" maxPoll="400" pollWaitMillis="40000" deployRoot="src" checkOnly="true" testLevel="RunSpecifiedTests">
            <runTest>MyTestClass</runTest>
            <runTest>MyOtherTestClass</runTest>
</sf:deploy>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.