Salesforcedx-vscode: 'Invoke Apex Tests' VS error message states that failed to run when tests have actually failed instead

Created on 25 Apr 2018  路  6Comments  路  Source: forcedotcom/salesforcedx-vscode

Summary

When running apex tests through the VS code command palette, any failing tests will throw a misleading error message.

Steps To Reproduce:

  1. Run a test class (Palette, Invoke Apex Tests) with at least 1 failing test.
  2. Review error message

Expected result

'Successfully ran with failing tests' (warning symbol?)

Actual result

'SFDX: Invoke Apex Tests... failed to run'

Output shows 'sfdx force:apex:test:run --resultformat human --loglevel error ended with exit code 100'

Additional information

image

VS Code Version:
1.22.2
SF Extensions: 42.12.0

SFDX CLI Version:
v42.0

OS and version:
Windows 10

Internal Work Item: W-5171290

bug

Most helpful comment

I am running this command: sfdx force:apex:test:run -l RunLocalTests -d ReleaseTest_Results -u %DEP_USER% --resultformat junit --codecoverage -w 200

sfdx version: 7.23.1-ced0ec4940.

I get an exit code of 100.

Can you please help?

All 6 comments

@Sweetman - I believe that you also raised this up. Do we already have the mechanisms in place to fix this? Or does this require a larger effort?

The mechanisms in place can be altered to fix this. Right now we only check for a 0 exit code in the notificationService and the CLI seems to have established 100 for test failures for apex/lightning. We would just be altering the notificationService.reportExecutionStatus to account for the test exit code. Another option is to write a separate reportExecutionStatus method for test commands if we want to separate it out for some reason.

Any update on this? We're also seeing this in our Blueocean (Jenkins) pipelines.

Are there any known workarounds?

This was addressed by PR #683

I am running this command: sfdx force:apex:test:run -l RunLocalTests -d ReleaseTest_Results -u %DEP_USER% --resultformat junit --codecoverage -w 200

sfdx version: 7.23.1-ced0ec4940.

I get an exit code of 100.

Can you please help?

I am getting this issue as well:

sfdx-cli/7.74.1 win32-x64 node-v10.15.3

VS Code 1.49.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StanZha picture StanZha  路  4Comments

simonfoden picture simonfoden  路  6Comments

Bgallahue picture Bgallahue  路  3Comments

ChuckJonas picture ChuckJonas  路  4Comments

vtandon-wiley picture vtandon-wiley  路  3Comments