1

In the build.xml , is there a way to specify a list of test classes to be added for running on deployment from a external file instead of hard coding it in the build.xml

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_deploy_run_specific_tests.htm

<target name="deployCode">
    <sf:deploy username="${sf.username}" password="${sf.password}" 
           sessionId="${sf.sessionId}" serverurl="${sf.serverurl}"
           deployroot="codepkg" testLevel="RunSpecifiedTests">
        <runTest>TestClass1</runTest>
        <runTest>TestClass2</runTest>
        <runTest>TestClass3</runTest>
    </sf:deploy>
</target>

In thee above the TestClass1, TestClass2, TestClass3. I would like that to be read from another file int he root folder.

1 Answer 1

1

It's not possible using just what's included in the Ant Toolkit. I would recommend asking this on Stack Overflow to see if someone has an Ant-only solution (I'd be interesting in hearing about that, too, just for my own edification).

I would recommend moving to Salesforce DX, which allows you to use Test Suites. A suite is configured in Salesforce, and can be referenced by name in a bash script. It's also perfectly possible to use bash to read the contents of a file into a variable, then put that in place of a parameter to DX, which is functionally equivalent to what you're asking for, just in a different toolkit.

You must log in to answer this question.

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