Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#3,447 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
领域
cli

调研方向

首先,使用链接的示例元数据和 JSON 输出,通过 sf flow run test 重现该问题,然后将空的 Message 字段与 Flow Test UI 中显示的自定义失败消息进行比较。payload 未指出任何仓库文件或测试;完成标准是 CLI 的 JSON 输出包含自定义断言错误消息。

由索引模型根据 Issue 内容生成。

描述

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)"
  ]
}
主要语言
没有语言数据
星标
571
派生
80
平均合并
14 小时 43 分钟
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

forcedotcom/cli 的其他 Issue

查看 forcedotcom/cli 的全部 Issue

相似的 Issue

更多 CLI Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。