- edited description
Code coverage shown as 0 % although all tests ran successfully
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)
-
reporter -
reporter It works correctly if I select More Run/Debug > Run ‘All tests …..' with Coverage:
-
reporter Illuminated Cloud > Show Coverage Data work fine if tests have once been run with More Run/Debug > Run ‘All tests …..' with Coverage.
-
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?
-
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.
-
reporter - marked as trivial
- marked as enhancement
-
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.
-
repo owner - changed status to resolved
-
repo owner - changed component to Apex Unit Testing
- Log in to comment