Test Your Package Versions with ISV Hammer (Beta)

Before each major release, Salesforce runs customers’ Apex tests against the old and new versions of our app. We call this process hammer testing, and it helps us avoid breaking things when we roll out the new version. Now we’re sharing the joy of hammers with you. Use ISV Hammer to test the installation of your package upgrades in copies of subscribers’ orgs before you roll out new versions of your package. (These metatdata-only org copies contain no customer data, are not human-accessible, and are deleted at the end of each ISV Hammer run.) This feature is now available for beta testing. For information on enabling this feature, contact Salesforce.
Note

Note

As a beta feature, ISV Hammer is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for this feature in the ISV Hammer group in the Trailblazer Community.

Where: This change applies to Lightning Experience, and Enterprise and Unlimited editions. In addition, ISV Hammer can only be enabled in the orgs with Developer Hub enabled. And for all the packages that are intended to be tested, namespaces for those packages need to be added to the Namespace Registry. See Link a Namespace to a Dev Hub Org.

How:

To start ISV Hammer tests, run the Salesforce CLI command sfdx force:package:hammertest:run.
Use this command to run ISV Hammer for the specified package versions and subscriber orgs.

If Salesforce has enabled Multiple Managed Packages for your org, you can test more than one package version. Supply the IDs of the package versions you want to test in the desired order of execution.

The command creates a copy of each of the supplied subscriber orgs and tests the package upgrade in each of them.

If a scheduled date/time is supplied, validation and setup start immediately but the package upgrade test does not start until after the supplied date/time. Format the --scheduledrundatetime value as YYYY-MM-DD HH:mm:ss in the GMT timezone. This date cannot be more than 25 days from today.

To test against the Salesforce preview release version, during the sandbox preview window, include --preview and a --scheduledrundatetime value that’s immediately after a staggered release, based on the Salesforce release calendar.

To run the package version’s Apex tests in each subscriber org after successfully testing the package upgrade, include --apextests.

The command returns a request ID. (This ID always starts with 0TW). Use this ID to query for the test status by running sfdx force:package:hammertest:report -i 0TW....

Examples:
sfdx force:package:hammertest:run --targetusername you@yourpackagingorg.com \
--packageversionids 04t...a,04t...b \
--subscriberorgs 00D...a,00Dx...b
sfdx force:package:hammertest:run -u you@yourpackagingorg.com -i 04txxxxxx \
--subscriberfile subscriberOrgs.txt
For details about the status of an in-progress ISV Hammer run, or to see the results of a completed run, run sfdx force:package:hammertest:report.
Example:
sfdx force:package:hammertest:report --targetusername you@yourpackagingorg.com \
--requestid 0TWxxxxxxxx
To list your ISV Hammer runs, run sfdx force:package:hammertest:list.
Examples:
sfdx force:package:hammertest:list --targetusername you@yourpackagingorg.com \
--packageversionid 04txxxxxxxxx
sfdx force:package:hammertest:list -u you@yourpackagingorg.com