I have a whole slew of testMethods in an AccountTriggerHandlerTest class. When I run the class as a whole, I get about 60% coverage, and it shows me that I'm missing one of my trigger methods. However, when I run the testMethod that exclusively applies to covering that trigger method, it correctly shows that it covers that testMethod. Why would it not cover it when run in aggregate but cover it when run in isolation? I have parallel testing disabled...
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Are you relying on specific data in the org? (i.e. using seeAllData=true). If so, that could be interfering if something else is updating a record that trigger is also using. Sounds more like a problem (bug) with the test coverage reporting though; I suspect in cases where it's vital (i.e. deploying) the coverage will be calculated correctly.