Show failing tests after running a dry deployment (–checkonly) in Salesforce

Reading Time: < 1 minutes

sfdx force:source:deploy -x manifest/package.xml -l RunLocalTests --checkonly
*** Deploying with SOAP API ***
Deploy ID: 0Bf7D000003ygUYWBY
SOURCE PROGRESS | █████████████████████████████████░░░░░░░ | 92/111 Components

=== Component Failures [0]
Type  Name  Problem
────  ────  ───────

=== Test Results Summary
Passing: 30
Failing: 17
Total: 47
Time: 0
ERROR running force:source:deploy:  Deploy failed.
sfdx force:source:deploy:report -i 0Bf7D000003ygUYWBY  --json > deploy.log

Open deploy.log and look for the node “runTestResult” and then “failures”.


 "failures": [
            "id": "01p0W000003fXQIQA2",
            "message": "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Validation Formula [THE COMPLETE ERROR HERE] ",
            "methodName": "myUnitTest",
            "name": "MyApexClass",
            "packageName": "MyApexClass",
            "stackTrace": "MyApexClass myUnitTest: line 38, column 1",
            "time": "1927.0",
            "type": "Class"

Photo by Siora Photography on Unsplash

About the author

Andrés Canavesi
Andrés Canavesi

Software Engineer with 15+ experience in software development, specialized in Salesforce, Java and Node.js.

Related posts

Leave a Reply

%d bloggers like this: