forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
490 stars 78 forks source link

Confusing help doc for `sf apex run test` #2580

Closed Kevmo92 closed 9 months ago

Kevmo92 commented 10 months ago

Summary

Running sf apex run test --help I see this comment:

-s, --suite-names=<value>...  Apex test suite names to run; default is all suites.
...
  -s, --suite-names=<value>...  Apex test suite names to run; default is all suites.

    If you select --suite-names, you can't specify --class-names or --tests.
    For multiple suites, repeat the flag for each.
    --suite-names Suite1 --suite-names Suite2

Notice that it mentions default is all suites. twice in the help doc.

When I run sf apex run test -s -c -r tap -w 20 I get the following error:

Error (1): Flag --suite-names expects a value

Why do I need to supply a value if there is a default to run all test suites?

Steps To Reproduce

Run sf apex run test -s -c -r tap -w 20 in an org with test suites deployed

Expected result

I expect all of the test suites to run.

Actual result

I get an error asking for test suite values.

System Information

Bash

{
  "architecture": "darwin-x64",
  "cliVersion": "@salesforce/cli/2.17.14",
  "nodeVersion": "node-v18.18.2",
  "osVersion": "Darwin 22.6.0",
  "rootPath": "/Users/kevinwatson/.fnm/node-versions/v18.18.2/installation/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.1 (core)",
    "@oclif/plugin-commands 3.0.6 (core)",
    "@oclif/plugin-help 6.0.5 (core)",
    "@oclif/plugin-not-found 3.0.3 (core)",
    "@oclif/plugin-plugins 4.1.7 (core)",
    "@oclif/plugin-search 1.0.6 (core)",
    "@oclif/plugin-update 4.1.3 (core)",
    "@oclif/plugin-version 2.0.6 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.2 (core)",
    "@oclif/plugin-which 3.0.8 (core)",
    "@salesforce/cli 2.17.14 (core)",
    "apex 2.3.20 (core)",
    "auth 2.8.26 (core)",
    "data 2.6.3 (core)",
    "deploy-retrieve 1.20.0 (core)",
    "info 3.0.1 (core)",
    "limits 3.0.1 (core)",
    "login 2.0.1 (core)",
    "marketplace 1.0.2 (core)",
    "org 2.11.8 (core)",
    "packaging 1.27.2 (user)",
    "schema 3.0.1 (core)",
    "settings 2.0.2 (core)",
    "signups 1.4.22 (user)",
    "sobject 0.2.15 (core)",
    "source 2.11.0 (core)",
    "telemetry 3.1.0 (core)",
    "templates 55.5.18 (core)",
    "trust 3.0.2 (core)",
    "user 2.3.42 (core)"
  ]
}
github-actions[bot] commented 10 months ago

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.

git2gus[bot] commented 10 months ago

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

mshanemc commented 10 months ago

yeah, that do is straight-up wrong. There is no default for it (otherwise, it would be impossible to run just a single test because it would be running all the suites!)

Kevmo92 commented 10 months ago

@mshanemc Thank you kindly! Insanely quick turn around on this!

jshackell-sfdc commented 9 months ago

This issue is fixed in 2.20.7 (Dec 6, 2023).