Ignore code coverage metrics for non-test methods in test classes

Issue #227 resolved
Scott Wells repo owner created an issue

From the discussion forums:

https://groups.google.com/a/illuminatedcloud.com/forum/#!topic/qanda/15AyLofKrX8

The Code Coverage functionality is great. IlluminatedCloud is showing exactly what Salesforce is calculating/reporting for coverage. However, what Salesforce reports is incorrect for any UnitTest that has non-test related code. See this help article:

https://help.salesforce.com/apex/HTViewSolution?urlname=Why-is-a-Test-class-evaluated-as-part-of-the-Organization-s-Code-Coverage&language=en_US

For example, one of my current projects is reporting coverage of 60.11%, however if I manually calculate it by removing unit tests, it's actually 98%. This is the difference between me thinking my project is in a state where it can and cannot be deployed/uploaded.

Currently our only options for calculating the "true" aggregate coverage are: manually with a calculator, or via a pass/fail result from performing a "validate" deployment to production (if you're a customer), or uploading a new package (if you're an ISV).

Now, yes it seems silly to make IC workaround Salesforce's shortcoming here, but it would be tremendously useful if there was a setting that caused the aggregate code coverage results panel to ignore the line counts (both covered and uncovered) from any class that's a test (@isTest / testMethod).

Comments (3)

  1. Log in to comment