Code coverage shown as 0 % although all tests ran successfully

Issue #2264 resolved
René Görgens created an issue

Hi Scott,

I have an issue with test coverage in a version controlled SFDX project against an OAuth sandbox connection.

  • I re-run all tests (Ctrl+F5). All tests succeed:

  • On the classes branch, I select Illuminated Cloud > Show Coverage Data:

  • Coverage is shown as 0 %:

  • Unit Tests and Code Coverage settings:

Please find the log attached.

Comments (9)

  1. René Görgens reporter

    It works correctly if I select More Run/Debug > Run ‘All tests …..' with Coverage:

  2. René Görgens reporter

    Illuminated Cloud > Show Coverage Data work fine if tests have once been run with More Run/Debug > Run ‘All tests …..' with Coverage.

  3. Scott Wells repo owner

    Just to clarify, the first run was without with Coverage, correct? If so, this is expected behavior since you don’t have Always collect code coverage when tests are run enabled and coverage is shown properly when you run it with Coverage. Or am I misunderstanding what you’re saying here?

  4. René Görgens reporter

    No you’re right. It’s just that I can select Show Coverage Data when that action is actually not going to show the coverage (respectively, the coverage is shown as 0 %). So ideally, this would be grayed out until coverage data are actually available. Or the user would be warned that coverage data are not available, with the steps to get them. So this then becomes an enhancement request, if anything.

  5. Scott Wells repo owner

    Show Coverage Data is a core JetBrains IDE action that I integrated into the IC2 menu for convenience because it’s quite difficult to find in JetBrains IDEs other than IntelliJ IDEA. It has its own rules for how/when it’s enabled/disabled/visible/hidden, and of course they don’t take into account whether Salesforce coverage has been collected. Unfortunately there’s not much that can be done wrt that action.

  6. Log in to comment