cli icon indicating copy to clipboard operation
cli copied to clipboard

sf agent generate test-spec generates a Yaml with empty expectedActions array

Open fedegiust opened this issue 6 months ago • 9 comments

Summary

I've uploaded a CSV to Testing Center having Expected Topic, Expected Actions and so on. I downloaded the aiEvaluationDefinition and tried the sf agent generate test-spec command. This gives me the YAML file, but with empty expectedActions

Image

Steps To Reproduce

Not sure if it's easily reproducible everywhere but

  • Download the template csv for testing center
  • In expected action create an array of expected actions for your test
  • Download the aiEvaluationDefinition metadata
  • run sf agent generate test-spec

[!TIP] use sf doctor --create-issue to automatically fill the required information

Expected result

The Yaml to have the correct expected actions array

Actual result

Expected Actions is empty

System Information

Using zsh

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.90.4",
  "nodeVersion": "node-v22.12.0",
  "osVersion": "Darwin 24.5.0",
  "rootPath": "/usr/local/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.29 (core)",
    "@oclif/plugin-commands 4.1.25 (core)",
    "@oclif/plugin-help 6.2.28 (core)",
    "@oclif/plugin-not-found 3.2.52 (core)",
    "@oclif/plugin-plugins 5.4.38 (core)",
    "@oclif/plugin-search 1.2.24 (core)",
    "@oclif/plugin-update 4.6.41 (core)",
    "@oclif/plugin-version 2.2.28 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.40 (core)",
    "@oclif/plugin-which 3.2.35 (core)",
    "@salesforce/cli 2.90.4 (core)",
    "agent 1.22.2 (user)",
    "apex 3.6.18 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.122 (core)",
    "code-analyzer 5.0.0 (user)",
    "custom-metadata 3.3.46 (user)",
    "data 4.0.34 (core)",
    "deploy-retrieve 3.22.15 (core)",
    "info 3.4.63 (core)",
    "limits 3.3.55 (core)",
    "marketplace 1.3.8 (core)",
    "org 5.7.10 (core)",
    "packaging 2.13.4 (core)",
    "schema 3.3.63 (core)",
    "settings 2.4.29 (core)",
    "signups 2.6.13 (user)",
    "sobject 1.4.58 (core)",
    "telemetry 3.6.41 (core)",
    "templates 56.3.48 (core)",
    "trust 3.7.93 (core)",
    "user 3.6.23 (core)",
    "@salesforce/sfdx-scanner 4.8.0 (user)",
    "sfdmu 4.38.0 (user)",
    "sfdx-git-delta 6.1.1 (user)",
    "sfdx-plugin-source-read 1.4.2 (user)"
  ]
}

fedegiust avatar Jun 06 '25 18:06 fedegiust

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

github-actions[bot] avatar Jun 06 '25 18:06 github-actions[bot]

Hello @fedegiust :wave: None of the versions of sf you shared match the latest release.

Shared: 2.90.4 Latest: 2.91.6

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

github-actions[bot] avatar Jun 06 '25 18:06 github-actions[bot]

I just updated to the most recent sf cli version and still get the same result

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.91.6",
  "nodeVersion": "node-v22.12.0",
  "osVersion": "Darwin 24.5.0",
  "rootPath": "/usr/local/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.29 (core)",
    "@oclif/plugin-commands 4.1.25 (core)",
    "@oclif/plugin-help 6.2.28 (core)",
    "@oclif/plugin-not-found 3.2.53 (core)",
    "@oclif/plugin-plugins 5.4.38 (core)",
    "@oclif/plugin-search 1.2.24 (core)",
    "@oclif/plugin-update 4.6.41 (core)",
    "@oclif/plugin-version 2.2.28 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.40 (core)",
    "@oclif/plugin-which 3.2.35 (core)",
    "@salesforce/cli 2.91.6 (core)",
    "agent 1.22.2 (user)",
    "apex 3.6.19 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.124 (core)",
    "code-analyzer 5.0.0 (user)",
    "custom-metadata 3.3.46 (user)",
    "data 4.0.36 (core)",
    "deploy-retrieve 3.22.17 (core)",
    "info 3.4.65 (core)",
    "limits 3.3.55 (core)",
    "marketplace 1.3.8 (core)",
    "org 5.7.12 (core)",
    "packaging 2.13.6 (core)",
    "schema 3.3.64 (core)",
    "settings 2.4.29 (core)",
    "signups 2.6.13 (user)",
    "sobject 1.4.58 (core)",
    "telemetry 3.6.42 (core)",
    "templates 56.3.48 (core)",
    "trust 3.7.96 (core)",
    "user 3.6.24 (core)",
    "@salesforce/sfdx-scanner 4.8.0 (user)",
    "sfdmu 4.38.0 (user)",
    "sfdx-git-delta 6.1.1 (user)",
    "sfdx-plugin-source-read 1.4.2 (user)"
  ]
}

fedegiust avatar Jun 06 '25 18:06 fedegiust

Also if I create a test run with this bad yaml and deploy, the test get stuck in progress for ever

fedegiust avatar Jun 06 '25 18:06 fedegiust

I've recreated, and confirmed, it's a problem with the encoding <expectedValue>["Check_Weather"]</expectedValue> works,

<expectedValue>[&apos;Check_Weather&apos;]</expectedValue> fails

WillieRuemmele avatar Jun 06 '25 18:06 WillieRuemmele

This issue has been linked to a new work item: W-18727048

git2gus[bot] avatar Jun 06 '25 18:06 git2gus[bot]

I was thinking about this over the weekend... did the encoded &apos; start being retrieved from the server? or is it coming from an os-difference across developer's machines working in a VCS? How / when did you first start seeing these as encoded

WillieRuemmele avatar Jun 09 '25 14:06 WillieRuemmele

That’s just the metadata retrieved from the org after uploading the csv for the testsEnviado desde mi iPhoneEl 9 jun. 2025, a la(s) 11:14 a. m., Willie Ruemmele @.***> escribió:WillieRuemmele left a comment (forcedotcom/cli#3314) I was thinking about this over the weekend... did the encoded ' start being retrieved from the server? or is it coming from an os-difference across developer's machines working in a VCS? How / when did you first start seeing these as encoded

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

fedegiust avatar Jun 09 '25 19:06 fedegiust

I tried replacing the ' with the single quotes and didn't work, still the generated spec has the expectedActions blank

fedegiust avatar Jun 11 '25 17:06 fedegiust

This was released in 2.95.6 - thanks for reporting 🚀

WillieRuemmele avatar Jul 09 '25 16:07 WillieRuemmele