-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Note
Before you submit your issue, make sure that:
- You're using the latest version of Salesforce CLI.
- You've searched both open and closed issues for related posts.
- You've used the
doctorcommand to diagnose common issues.- You understand that GitHub Issues don't adhere to any agreement or SLA.
- If you require immediate assistance, use official channels such as Salesforce Customer Support.
Summary
I am encountering a parsing error when running sf project deploy start. I am trying to run specified tests using -l RunSpecifiedTests followed by a space-separated list of tests using -t.
The CLI seems to interpret the -t flag and the subsequent test names as part of the string value for the -l (test-level) flag, causing a validation error
Steps To Reproduce
IMPORTANT
Provide a repository that's configured to reproduce the issue. If you are unable to provide a repo, please explain why not. The more info we have from the start, the faster we can resolve your issue.
We may close your issue if you don't include proper instructions.
- Generate a project with
sf project generateor fork dreamhouse-lwc.- Provide detailed step-by-step instructions on how to reproduce the issue.
Tip
use sf doctor --create-issue to automatically fill the required information
Steps To Reproduce
Execute the following command (passing multiple tests via command line or variable):
Bash
sf project deploy start -d force-app/main/default -o TARGET_ORG -l RunSpecifiedTests -t TestClass1 TestClass2 TestClass3 TestClass4 TestClass5 --dry-run -w 60
Note: This often happens when passing the flags via a shell variable that is improperly quoted during execution.
Expected result
The command should accept RunSpecifiedTests as the value for -l and then process the list of tests provided after -t separately.
Actual result
The command fails immediately with an argument validation error. It appears to be reading the entire string after -l as a single argument including the test names.
Error Output:
Plaintext
Error (1): Expected --test-level= RunSpecifiedTests -t TestClass1 TestClass2 TestClass3 TestClass4 TestClass5 --dry-run to be one of: NoTestRun, RunSpecifiedTests, RunLocalTests, RunAllTestsInOrg
System Information
bash 2.109.7PASTE_VERSION_OUTPUT_HERE