Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`sf flow run test` does not return a custom error message

Aperta
#3,447 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Ambito
cli

Direzione di ricerca

Inizia riproducendo il problema con sf flow run test usando i metadati di esempio collegati e l'output JSON, quindi confronta il campo Message vuoto con il messaggio di errore personalizzato mostrato in Flow Test UI. Il payload non indica file o test del repository; il lavoro è completato quando l'output JSON della CLI include il messaggio di errore dell'asserzione personalizzata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug owned by another team validated
Summary

If you execute a Flow Test with Salesforce CLI command sf flow run test it does not return a custom error message for a failed FlowTest, but it is displayed in the FlowTest UI

Steps To Reproduce

General Steps:
Create a Flow Test for a record triggered Flow
Create an assertion which will fail and define a custom error message in the assertion
Run the Flow Test in the UI - inspect errors with "Run Test and View Details" next to the Flow Test Table row - for the failure you will the custom error message
Run the same Flow Test from the CLI with output format JSON -> "message" will be empty

Sample Metadata to Reproduce

Clone repo https://github.com/ChristianMenzinger/flow-test-metadata
Create a new scratch org
Push all metadata to new scratch org
Open Org, Open Flow Builder for Flow "Check Escalated in Cases"
Open "View Tests"
Click chevron on the test row and select "Run Test and View Details"
Inspect the failed assertion:

The assertion failed because a condition was not met.
Condition
{!$Record.IsEscalated} Equals true
Custom failure message
Escalated was not set to true.
Condition evaluation
{!$Record.IsEscalated} (false) Equals true

Notice the custom failure message "Escalated was not set to true"

Run the same test with the CLI command:
sf flow run test -t Check_Escalated_in_Cases.Check_Escalated_in_Cases_Created_Status_is_Escalated_Escalated_is_False -r json -y

Inspect the output:

{
  "status": 100,
  "result": {
    "summary": {
      "failRate": "100%",
      "failing": 1,
      "hostname": "https://customization-speed-3216-dev-ed.scratch.my.salesforce.com",
      "orgId": "00DKO000000NIzq2AG",
      "outcome": "Failed",
      "passRate": "0%",
      "passing": 0,
      "skipped": 0,
      "testRunId": "",
      "testStartTime": "2025-11-05T14:52:16.731Z",
      "testsRan": 1,
      "username": "[email protected]",
      "commandTime": "1 ms",
      "testExecutionTime": "276 ms",
      "testTotalTime": "276 ms"
    },
    "tests": [
      {
        "Id": "",
        "QueueItemId": "",
        "StackTrace": "",
        "Message": "",
        "AsyncApexJobId": "",
        "MethodName": "Created: Status is Escalated, Escalated is False",
        "Outcome": "Fail",
        "ApexClass": {
          "Id": "07MKO000003z7am2AA",
          "Name": "Check_Escalated_in_Cases",
          "NamespacePrefix": "flowtesting"
        },
        "RunTime": 42,
        "FullName": "flowtesting__Check_Escalated_in_Cases.Created: Status is Escalated, Escalated is False"
      }
    ]
  }
}

Notice "Message" is empty

Expected result

"Message" should display the custom error message as in the Flow Test UI

Actual result

"Message" is empty

System Information
{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.110.22",
  "nodeVersion": "node-v22.21.0",
  "osVersion": "Darwin 24.6.0",
  "rootPath": "/Users/christianmenzinger/.local/share/sf/client/2.110.22-7013be3",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.37 (core)",
    "@oclif/plugin-commands 4.1.35 (core)",
    "@oclif/plugin-help 6.2.33 (core)",
    "@oclif/plugin-not-found 3.2.70 (core)",
    "@oclif/plugin-plugins 5.4.50 (core)",
    "@oclif/plugin-search 1.2.33 (core)",
    "@oclif/plugin-update 4.7.11 (core)",
    "@oclif/plugin-version 2.2.34 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.50 (core)",
    "@oclif/plugin-which 3.2.41 (core)",
    "@salesforce/cli 2.110.22 (core)",
    "agent 1.24.18 (core)",
    "apex 3.8.3 (core)",
    "api 1.3.3 (core)",
    "auth 3.9.17 (core)",
    "data 4.0.59 (core)",
    "deploy-retrieve 3.23.8 (core)",
    "flow 1.0.2 (user) published 197 days ago (Mon Apr 21 2025)",
    "info 3.4.93 (core)",
    "limits 3.3.67 (core)",
    "marketplace 1.3.8 (core)",
    "org 5.9.38 (core)",
    "packaging 2.22.0 (core)",
    "schema 3.3.82 (core)",
    "settings 2.4.48 (core)",
    "sobject 1.4.76 (core)",
    "telemetry 3.6.61 (core)",
    "templates 56.3.66 (core)",
    "trust 3.7.113 (core)",
    "user 3.6.38 (core)",
    "sfdx-plugin-package-xml 0.0.0-development (link) /Users/christianmenzinger/dev/metacache/sfdx-plugin-package-xml",
    "sfdx-plugin-source-read 1.5.6 (user) published 52 days ago (Sun Sep 14 2025)"
  ]
}
Lingua principale
Nessun dato sulla lingua
Stelle
571
Fork
80
Merge medio
2g 21h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di forcedotcom/cli

Tutte le issue di forcedotcom/cli

Issue simili

Altre issue su CLI

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.