Closed jamessimone closed 2 weeks ago
Hello @jamessimone :wave: It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json
for the CLI you're using (sf
or sfdx
).
A few more things to check:
rc
or nightly
versions. (docs)doctor
command to diagnose common issues.Thank you!
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.
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
This issue should not be closed
hey, sorry for the late reply.
the command should return the same exit code that sfdx-lwc-test
does:
https://github.com/salesforcecli/plugin-lwc-test/blob/024530c2ac27f3097f4edb075ccb1cc3b14cabf4/src/commands/force/lightning/lwc/test/run.ts#L60
but looking at the e2e test it seems that hasn't been the case: https://github.com/salesforcecli/plugin-lwc-test/blob/024530c2ac27f3097f4edb075ccb1cc3b14cabf4/test/commands/lwc/test/run.nut.ts#L84
we'll discuss with the owners of sfdx-lwc-test
about the current state of the lwc commands and get back.
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
Bump
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
Bump
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
Bump
@jamessimone - Thanks for keeping this bumped.
My team connected with the team that owns sfdx-lwc-jest
We confirmed that the behavior of sf force lightning lwc test run
is incorrect. The command should exit with a status code of 1
if any tests fail.
The CLI team will explore a fix for this issue, but I can't provide a timeline.
This issue has been linked to a new work item: W-16884223
@VivekMChawla thanks for keeping us updated, it's much appreciated
This issue has been fixed in CLI version 2.62.6 (October 16, 2024).
@jshackell-sfdc thanks!
Summary
Using latest CLI version (
@salesforce/cli/2.55.6 win32-x64 node-v20.16.0
), these two commands differ when encountering failing LWC jest tests:This improperly suppresses failures when relying on exit codes (such as in pipeline runs)
Steps To Reproduce
Expected result
CLI should return exit code 1 when using
sf force lightning lwc test run
with any test failureActual result
CLI returns exit code 0