1

Test class does not run when I use --runtests

What's up community, I'm trying to deploy a deploy with its respective test class. But the problem is that it does not run the test class and I specify it in the command line.

enter image description here

This is the command line:

sfdx force:source:deploy --targetusername [email protected]  --manifest releases/package.xml --testlevel RunSpecifiedTests --runtests ClasePruebaAzureTest --checkonly

This is the manifest I use:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
       <members>ClasePruebaAzure</members>
       <members>ClasePruebaAzureTest</members>
       <name>ApexClass</name>
    </types>
    <version>55.0</version>
</Package>

1 Answer 1

-1

Assuming your whole command/file is correct as you have shared a screenshot of the validation actually running in org.

Shift you declaration of the --checkonly before testlevel

sfdx force:source:deploy --targetusername [email protected]  --manifest releases/package.xml --checkonly --testlevel RunSpecifiedTests --runtests ClasePruebaAzureTest
2
  • Try changing the order of the --checkonly and it still doesn't run the test classes. Now I am thinking that it is no longer the command line, but the Org, because, I run the same command line in another Org and it does run the test class. Sep 27, 2022 at 14:28
  • Order of switches doesn't matter for sfdx (or most command line commands).
    – Frans
    Sep 4, 2023 at 13:20

You must log in to answer this question.

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