[SalesForce] Unable to Run Tests from VSCode

Recently, I have been unable to run tests from VSCode, using the 'Run Test' or 'Run All Tests' links that display inline. I can still run the tests in the Salesforce Developer Console, just not from VSCode. I get the error message:

09:53:46.173 Starting Run Apex Tests
This class name's value is invalid: [namespace].[namespace]. Provide the name of an Apex class that has test methods.

Where [namespace] is the name of my namespace as defined in the sfdx-project.json file.

This is occurring against a scratch org and I have tried creating new scratch orgs multiple times and still getting the same message.

Currently running sfdx-cli/7.84.2-a2868a68d5 darwin-x64 node-v12.18.3

Best Answer

@Vinay thanks for pointing me to that. It is a new feature that is causing it. In the settings there is a new feature that needs to be disabled and that fixed it for me.

In Settings: Salesforcedx-vscode-core > Experimental: Use Apex Library
Disable - Use Apex Library for Apex CLI Commands enter image description here