amtrack / force-dev-tool

[DEPRECATED] Command line tool supporting the Force.com development lifecycle
MIT License
108 stars 37 forks source link

force-dev-tool deploy with test #104

Closed rodolfonoviski closed 6 years ago

rodolfonoviski commented 6 years ago

When trying to run the command:

$ force-dev-tool package grep 'ApexClass\*Test' -- template config/deployments/deploy2212 | cut -d '\' -f 2 | xargs -0 force-dev-tool deploy -d config/deployments/deploy2212/ --runTests is not running any test class

amtrack commented 6 years ago

Hi @rodolfonoviski, that command is slightly wrong. The separator is a slash (e.g. ApexClass/FooTest) and the --template (deprecated) respectively -f expects the path to a package.xml file instead of a folder.

Please iteratively check the output of all parts of the command:

The first part should list the names of your test classes (with a leading ApexClass/ each).

$ force-dev-tool package -f config/deployments/deploy2212/package.xml grep 'ApexClass/*Test'

The next command should strip off the leading ApexClass/ per line.

$ force-dev-tool package -f config/deployments/deploy2212/package.xml grep 'ApexClass/*Test' | cut -d '/' -f 2

If this was all correct, you should be able to put everything together in order to perform the deployment:

$ force-dev-tool package -f config/deployments/deploy2212/package.xml grep 'ApexClass/*Test' | cut -d '/' -f 2 | xargs -0 force-dev-tool deploy -d config/deployments/deploy2212 --runTests