4

In user setting.JSON I am using

{
    "salesforcedx-vscode-apex.java.home":"C:\\Program Files\\Java\\jdk1.8.0_131",
    "salesforcedx-vscode-core.show-cli-success-msg": true,
    "salesforcedx-vscode-core.retrieve-test-code-coverage": true
}

in workspace setting I am using

{
  "salesforcedx-vscode-core.push-or-deploy-on-save.enabled": true,
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/.sfdx": true
  },
  "eslint.nodePath": "c:\\Users\\e3027618\\.vscode\\extensions\\salesforce.salesforcedx-vscode-lwc-45.13.0\\node_modules",
  "salesforcedx-vscode-core.show-cli-success-msg": true,
  "salesforcedx-vscode-core.retrieve-test-code-coverage": true
}

But Still I am getting the below error message:

No code coverage information was found for test run 7070U00000r8Ny3. Set "salesforcedx-vscode-core.retrieve-test-code-coverage": true in your user or workspace settings, then run Apex tests from the Apex Tests sidebar or using the Run Tests or Run All Tests code lens within a test class file.

1

Do exactly as the error says and add salesforcedx-vscode-core.retrieve-test-code-coverage to your workspace settings:

{
    "salesforcedx-vscode-apex.java.home":"C:\\Program Files\\Java\\jdk1.8.0_131",
    "salesforcedx-vscode-core.show-cli-success-msg": true,
    "salesforcedx-vscode-core.retrieve-test-code-coverage": true
}
  • Thank you so much for responding Brian, I have updated as you said and I have updated my question as well but still, the error is still the same. – gs650x May 7 at 12:40
  • I believe when you run the actual test, you have to set a parameter that saves the code coverage. Look through the sfdx docs for running apex tests – Brian Miller May 7 at 13:56
  • I have got the this documentation forcedotcom.github.io/salesforcedx-vscode/articles/apex/testing and I am doing exactly what is written but it is not helpful at all – gs650x May 7 at 14:06
1

I was having a similar issue. I'd added "salesforcedx-vscode-core.retrieve-test-code-coverage": true into the user "settings.json" as instructed.

Yet the error message about "No code coverage information" was still appearing.

When I checked the Apex tests side bar there weren't any tests displayed to run.

enter image description here

Attempting to use the green Run Tests button there gave an error about configuring the Apex Language Server. Something had gone wrong with my "salesforcedx-vscode-apex.java.home" setting. After correcting that (See Activate the Apex Language Server) and restarting vscode the Apex Language Server started. And accessing the Apex tests side bar showed all the existing test cases.

When I ran them the coverage was now available.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.