`sf flow run test` does not return a custom error message
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- cli
调研方向
首先,使用链接的示例元数据和 JSON 输出,通过 sf flow run test 重现该问题,然后将空的 Message 字段与 Flow Test UI 中显示的自定义失败消息进行比较。payload 未指出任何仓库文件或测试;完成标准是 CLI 的 JSON 输出包含自定义断言错误消息。
由索引模型根据 Issue 内容生成。
描述
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 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
forcedotcom/cli 的其他 Issue
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShape可能已有人在做 @konkonrong-lgtm 于 73 天前认领。 未关闭area:afdx bug investigating owned by another team validated
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3625 · 4 条评论 ·
-
area:afdx bug owned by another team
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3608 · 2 条评论 ·
-
announcement
难度 1/5 1 小时以内 新手友好度 1/100
forcedotcom/cli#3668 ·
-
bug investigating validated
难度 3/5 1-2 天 新手友好度 66/100
forcedotcom/cli#3667 · 5 条评论 ·
-
[BUG]: NavigationMenu SourceMember name mismatch prevents source-tracked retrieve from completing未关闭bug investigating validated
难度 4/5 3-5 天 新手友好度 52/100
forcedotcom/cli#3660 · 3 条评论 ·
相似的 Issue
-
bug CLI documentation
难度 2/5 1-3 小时 新手友好度 67/100
openai/codex#56630 · 3 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
bug:wrong-behaviour domain:cli source:agent status:ready
难度 2/5 1-3 小时 新手友好度 78/100
-
bug effort:s impact:low raised-by:verifier risk:low
难度 2/5 1-3 小时 新手友好度 76/100
medici-finance/assay#4246 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 65/100
dominikgobel/kern#5 ·