Salesforce Run Specified Tests Feature

Salesforce Run Specified Tests Feature

December 7, 2015

There is one new very cool feature called “run specified tests”.

Whenever you run your deployment or validation you may now select unit tests you want to run! This can save deployment or validation time tremendously!

This feature has been initially introduced in the Summer’15 Release ( you may refer to related Release notes here or to Salesforce tutorial here ). There was a bug in this feature claimed to be fixed in Winter’16 Release, and that is cool, I guess.

To use this feature in your ANT Migration Tool you will require the latest Force.com Migration Tool jar, which you may download directly from your production org or from any of your sandboxes here.

Also you need to add a new target inside your build.xml file specifying which tests you would like to run:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<target name="1*. Deploy to Production running a few tests?">
<sf:deploy username="${sf.production.username}"
password="${sf.production.password}${sf.production.securityToken}"
serverurl="${sf.production.serverurl}"
deployRoot="../${sf.deploy.dir}/${sf.sandbox.dir}"
rollbackOnError="true"
maxPoll="${sf.maxPoll}"
testLevel="RunSpecifiedTests"
pollWaitMillis="${sf.pollWaitMillis}">
<runTest>TestClass1</runTest>
<runTest>TestClass1</runTest>
<runTest>TestClass1</runTest>
</sf:deploy>
</target>

Click share or like if you also enjoy this new feature!

Tags

ANTdeploymentexecutionForce.commigrationteststoolvalidation

Share


Recent Articles

Get 100% Code Coverage for Salesforce Custom Metadata Based Decisions

January 18, 2018 | Bohdan Dovhan

How to obtain a full coverage for code which uses Custom Metadata for strategy-like decision implementation? Introduction Many applications use configuration data. Configuration data might be relevant to the entire organization, or a subset of user, or even different for each user. For the purposes of this article, we will focus only on global configuration […]

Logging of Exceptions in Salesforce

January 11, 2018 | Mykola Senyk

Unpredicted behaviour in a custom code. Can we eliminate it? The ability to customize your Salesforce org code is not just a “nice to have.”  It greatly increases the capability and flexibility of Salesforce. However, custom code can also be tricky to use. It would be great if we could detect unpredicted behavior in our […]

© Copyright - CoreValue 2018
Salesforce, Sales Cloud, and others are trademarks of salesforce.com, inc., and are used here with permission.
Used with permission from Microsoft.