1

I'm trying to reach the reasons to use project validate instead of project start --dry-run. Due to, when using dry-run in project start, seems to have the same result of project validate.

  1. Project start Command: Deploy metadata to an org from your local project. Flag: --dry-run: Validate deploy and run Apex tests but don’t save to the org.
  2. Project validate Command: Validate a metadata deployment without actually executing it.

In both commands, after the end of the unit tests validation, an Id is available to use quick deploy. So that, what is the main difference in the result of the execution in deployment API, between both commands?

1
  • I am wondering the same thing, haven't been able to find anything specifying the difference. Commented Feb 5 at 23:17

1 Answer 1

0

You cannot run validate with --test-level set to NoTestRun, it will return an error

Expected --test-level=NoTestRun to be one of: RunAllTestsInOrg, RunLocalTests, RunSpecifiedTests

You can however do a dry run deployment while running no tests. It means the components can be validated without having to run tests (good for components which can be deployed without running tests).

This will fail:

sf project deploy validate --test-level NoTestRun --metadata LightningComponentBundle:MyComponent

This will validate the components:

sf project deploy start --dry-run  --test-level NoTestRun --metadata LightningComponentBundle:MyComponent

When to use validate

It seems you cannot do a quick deploy after doing a dry run deployment - it doesn't count it as a validation. So if you want to use the quick command you need to use validate

You must log in to answer this question.

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