Salesforcedx-vscode: Apex unit test shows blue/red when passing

Created on 19 Sep 2018  Â·  8Comments  Â·  Source: forcedotcom/salesforcedx-vscode

Summary

I'm running my unit tests, and they all pass. 100% pass. But two tests show as blue, and the overall icon show up as red. I tried running the tests in the developer console, and they are all green with green checkmark.

I've looked for differences between the tests that get the green circle and the ones that don't, but I can't find any (of course different test).

Even copied one of the green tests (remember ALL tests pass, but at least this one gets a green circle). And it still showed up as blue.

Perhaps there is some cached meta-data somewhere? My project originated as a convert from mdapi, and the test that get the green circle are the ones created before convert to DX. The ones which pass but get blue are written after conversion to DX.

VS Code Version:

1.27.2

SFDX CLI Version:

6.31.0, node 8.9.4

OS and version:

Windows 10

bug

Most helpful comment

Fix is out as part of v44.4.0 release.

All 8 comments

What happens when you hit the "refresh" icon on the apex side bar and then run the tests?

This might be related to W-5360967, where the Apex Test View doesn't distinguish between unrun (blue) and failing test (red) in some conditions.

I’ll try the refresh and get back with the results. It strange that the
tests that were written before converting to DX (in developer console, then
converted with mdapi) works (green) but even the very same teat code
(copy-paste with another method name) gets the blues.

ons. 19. sep. 2018 kl. 22:39 skrev Nick Chen notifications@github.com:

This might be related to W-5360967, where the Apex Test View doesn't
distinguish between unrun (blue) and failing test (red) in some conditions.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/forcedotcom/salesforcedx-vscode/issues/645#issuecomment-422950190,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC6h7INAbpsL2_-Etq5Q8r9mKPZ67DCSks5ucqt3gaJpZM4WwCuz
.

@lcampos - Per our discussion, our suspect is that it's picking up the wrong json file at the /tmp directory?

@vazexqi yes, we have a way to replicate the issue and logged a bug to track and fix it (W-5463028)
cc @ntotten

Is there any way to sort the list of test classes displayed in that sidebar?

Currently you cannot search in the tests area sidebar for a specific test class to run. If there is a way to sort them or by default sort them alphabetically so that we know where to scroll to.

Also, is there a way to show the code coverage on the actual class with red and green highlights just like developer console? Force.com IDE plugin used to have that feature.

Right now to see the covered lines, I am running the test in developer console to see the covered lines and had to switch back and forth between vscode and dev console.

Hi @venkatpolisetti, thanks for the feedback. Please follow issue #605 for search/sort of tests in the sidebar and #677 for showing code coverage.

I'm going to close this since the fix for the main issue is out.

Fix is out as part of v44.4.0 release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bgallahue picture Bgallahue  Â·  3Comments

celador picture celador  Â·  4Comments

sc5148 picture sc5148  Â·  4Comments

StanZha picture StanZha  Â·  4Comments

randi274 picture randi274  Â·  3Comments