-
Notifications
You must be signed in to change notification settings - Fork 83
Description
What are you trying to do
It would be nice to be able to specify a test suite name as part of deployment command that would be used to specify which tests should be executed as part of the deployment, as an alternative to the RunSpecifiedTests option.
For example, if I have apackage with manifest as follows:
package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Foo</members>
<members>FooTest</members>
<members>Bar</members>
<members>BarTest</members>
<name>ApexClass</name>
</types>
<types>
<members>MyTestSuite</members>
<name>ApexTestSuite</name>
</types>
</Package>And the test suite specifies the tests I want executed during deployment:
MyTestsuite.testSuite
<?xml version="1.0" encoding="UTF-8"?>
<ApexTestSuite xmlns="http://soap.sforce.com/2006/04/metadata">
<testClassName>FooTest</testClassName>
<testClassName>BarTest</testClassName>
</ApexTestSuite>Describe the solution you'd like
I would like to use a test level named RunTestSuite for example, that would require a test suite name be specified, possibily by reusing --runtests or with another flag. With this test level I don't have to explicitly list all my test classes I want to have run during deployment. Instead the tool would extract the list of tests from the test suite and run those.
Example:
$ sfdx force:mdapi:deploy \
--testlevel RunTestSuite \
--runtests MyTestSuite \
--deploydir mypackage \
--wait -1 \
-u alan
# Maybe also supports multiple test suites:
$ sfdx force:mdapi:deploy \
--testlevel RunTestSuite \
--runtests MyTestSuite1,MyTestSuite2,MyTestSuiteN \
--deploydir mypackage \
--wait -1 \
-u alan