Salesforcedx-vscode: 'Run test' fails in namespaced scratch org

Created on 15 Jan 2021  Â·  6Comments  Â·  Source: forcedotcom/salesforcedx-vscode

Summary
I'm developing a managed package in a namespaced scratch org. When I try to run a test from vs-code with the "Run Test" link, it fails, saying "This class name's value is invalid: .. Provide the name of an Apex class that has test methods."

Running a test from the command line is OK.

Steps To Reproduce:
Create a scratch org with a namespace
Create an Apex test class with some tests
Click the "Run Test" link on any test

Expected result
Test should run

Actual result
No test ran. An error message is returned:

12:44:21.910 Starting Run Apex Tests
This class name's value is invalid: .. Provide the name of an Apex class that has test methods.

VS Code Version: 1.52

SFDX CLI Version: sfdx-cli/7.84.2-a2868a68d5 darwin-x64 node-v12.18.3

OS and version: macOS Hi-Siera 10.13.1

namespaces bug

All 6 comments

Hi @aidandoyle1729 thanks for reporting this! We can confirm that this is reproducible on our end as well and we'll start working on a fix. As a workaround, since this feature is still in Beta, you can go back to the old behavior by going into your Preferences and turning off the Salesforcedx-vscode-core › Experimental: Use Apex Library setting.

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

Thanks @AnanyaJha effective workaround.

I ran into the same issue. The workaround of disabling "Experimental: Use Apex Library" worked.
I'm not sure if I explicitly enabled that setting, is it something that should be on by default if it is experimental?

Hi @FishOfPrey - Glad the workaround unblocked you!

As for the question on the setting: We are in the process of moving commands to libraries that VS Code and the CLI consume. (They can also be consumed and used by others.)  Last summer, we made the Apex library accessible via this setting so folks could try it out. Before we fully move to the library, we default to everyone using it, but with a fallback in case we find unexpected issues.  Once we complete the work for VS Code & the CLI, this setting will be removed.  I think we could come up with a better name for the settings because 'experimental' might sound a bit scary. Input welcome on better names.

[ We are doing the same for Deploy / Retrieve commands.  Turn on the "Experimental: Deploy Retrieve" setting to check it out ]

Closing. This should be resolved as of release v51.2.0. Thank you again for reporting this issue!

Was this page helpful?
0 / 5 - 0 ratings