Ignore code coverage metrics for non-test methods in test classes
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:
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)
-
reporter -
reporter - changed status to resolved
Issue tracker grooming.
-
reporter - changed component to Apex Unit Testing
- Log in to comment
Closely related to
#283. I'll likely work these two together.